Compiling KDE on OSX10.3 with gcc 3.3
Marijn Kruisselbrink
m.kruisselbrink at student.tue.nl
Wed Apr 4 16:52:44 CEST 2007
While trying to make kdelibs compile on OSX 10.3 with gcc 3.3, I
encountered a few problems:
When linking almost any executable (a few executables link fine), I get
a linking error which can be fixed by adding '-framework Foundation' to
the link line. (the error I'm getting is "ld: /usr/lib/crt1.o illegal
reference to symbol: __objcInit defined in indirectly referenced dynamic
library /usr/lib/libobjc.A.dylib").
Since I'm not sure what causes this problem, the only fix I can think of
is to somehow check if gcc 3.3 on OSX is being used, and if it is the
case link to Foundation. I guess a cleaner solution would be to check by
compiling some small program if this is required, but I haven't been
able to construct a small program that fails linking...
Anybody got any clever ideas on how to resolve this?
Another (more easy to fix) problem is caused by a bug in the cmath
include file provided by apple. The file #undef's various math functions
such as isnan/isinf without redefining them as functions unless
_GLIBCPP_USE_C99 is set. This could probably be fixed by checking if a
program using cmath and std::isnan failes to compile (while it would
compile with math.h), and if so define _GLIBCPP_USE_C99 in config.h?
Thanks, Marijn Kruisselbrink
More information about the Kde-buildsystem
mailing list