Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

titaniumdecoy

macrumors member
Original poster
Oct 13, 2005
86
0
I have a library that was built for linux which I want to include in a simple C++ program on my mac. However, I get this error:

Code:
ld: warning in <snip>/libsim.a, file is not of required architecture
Undefined symbols:
  <snip>

Is there some way to get this to work under X11 or similar? I know it works on Fedora Core 5. Thanks.
 
No. The ABIs are different between OSX and Linux. The library needs to be compiled for OSX.
 
What you have here is a collection of code compiled into a single file for the purposes of other programs being able to call functions from it. The code you have has been compiled for (probably) Intel Linux. It will not work as is for Intel OS X. You will need the original .c files and compile your own (or find it precompiled somewhere).
 
Damn.

I know it runs on Fedora Core 5. Does that mean it would run on any linux machine such as Ubuntu or Fedora 7?
 
Given that each Linux distribution is based on essentially the same kernel, one could presume yes.
 
I'd check to see if it's available in source or binary form for OSX via MacPorts or Fink.

If not, you could always install RPM via MacPorts or Fink and get the SIM ICQ (i.e. libsim) RPM source bundle and install it that way.
 
I found out (to my surprise) that the source was available. I compiled it and packaged it into a static library and it is now working fine, although it launches under X11.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.