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.
 

kpua

macrumors 6502
Jul 25, 2006
294
0
No. The ABIs are different between OSX and Linux. The library needs to be compiled for OSX.
 

numero

macrumors regular
Jul 23, 2002
106
3
OR
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).
 

titaniumdecoy

macrumors member
Original poster
Oct 13, 2005
86
0
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?
 

kpua

macrumors 6502
Jul 25, 2006
294
0
Given that each Linux distribution is based on essentially the same kernel, one could presume yes.
 

yeroen

macrumors 6502a
Mar 8, 2007
944
2
Cambridge, MA
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.
 

titaniumdecoy

macrumors member
Original poster
Oct 13, 2005
86
0
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.