[Bf-committers] linking error on OS X

Jean-Luc Peurière jlp at nerim.net
Thu Aug 24 18:54:25 CEST 2006


Le 23 août 06 à 23:44, Jasper Mine a écrit :

> Randall,
>
>   This compile error has been around since the release of gcc4 (a  
> long time).  You can turn off gameengine?, you can compile with  
> gcc3.3.  But you can't wish it will ever be fixed in cvs.  And I  
> would like proof of why lukep thinks it's c++ calls in c files...
>
> Because, on my intel mac I get several other linker options, and  
> with the following:  -undefined dynamic_lookup
> Set under LDFLAGS in blender/source/nan_link.mk I get a working  
> compile with gcc4.
>
> The man page for ld is quite large, but gives good hints on how osx  
> does symbols, namespaces, and after lots of searching, namespaces  
> could also be the culprit.  I would love to see it fixed because  
> out of the box blender doesn't compile anymore, at least with make.
>
> Try changing your compiler to gcc3.3 to get blender built.  In  
> terminal: sudo gcc_select 3.3
> Remember to change it back:  sudo gcc_select 4.0  BTW, I think this  
> works.

adding undefined dynamic_lookup seems indeed a good idea.

out of the box make compile with gcc3.3.

the 2 problem are simple, the offending calls are gcc2.95  
compatibility calls and C++ style exceptions handling in C. a C++ lib  
compiled with gcc3.3 will have those calls in the lib which used to  
be found in system  stdlibc++ up to Os X 10.3.9. Even on Os X 10.4,  
gcc3.3 use a SDK which provide this lib.

With GCC 4.0, this libstdc++ was turned to a dynamic loaded lib and  
dont have anymore those compat  calls. the static stdlibc++ do not  
more exist, in compliance with the new (itanium derived) ABI. So if  
one of the libs was generated from gcc3.3, it has those calls and  
dont find them at link time.
For the exception handling thing a C file calling a C++ lib (via a C- 
API file) wont generate the exception handling calls (except if - 
fexception was added to options) by default. So all C++ libs must be  
recreated with the correct gcc due to the ABI change. Especially  
Openal and OpenEXR.

This is what i gathered from multiple mailing list of developpers  
scratching their heads, trying to compile with gcc 4.0. One of the  
most useful ones was btw the python devel one where i found most (but  
not all) of the answers.

lukep


More information about the Bf-committers mailing list