How to solve 'Undefined symbol "_open$UNIX2003"' and similar

Thursday, January 08 2009 @ 01:35 PM GMT

Contributed by: Admin

How to solve these error messages at link time:


Undefined symbols:
>>   "_fcntl$UNIX2003", referenced from:
>>       ___gcov_open in SOME_LIB.a(_XXX.o)
>>   "_close$UNIX2003", referenced from:
>>       ___gcov_open in SOME_LIB.a(_XXX.o)
>>   "_open$UNIX2003", referenced from:
>>       ___gcov_open in SOME_LIB.a(_XXX.o)

You got these messages because the "SOME_LIB.a" library was linked against 10.5 SDK, but you are now using it in a project for which you now require 10.4 (or less) SDK.

Once you know why you got the errors, the solution is pretty obvious:
either you recompile the SOME_LIB.a with the required SDK - if you have the sources and if they are compatible with the targeted SDK,
either you have to raise the minimum compatibility level of the project linking to SOME_LIB.a to 10.5 SDK.

If none of these are possible, you are probably in big trouble…

0 comments



http://www.macosxguru.net/article.php?story=2009010813350633