Got an arcane linker error after switching to MacPorts from Fink.
Had to change OSG's top-level CMakeLists.txt:

....
IF(UNIX)
    # Not sure what this will do on Cygwin and Msys
    # Also, remember OS X X11 is a user installed option so it may not exist.
    FIND_PACKAGE(X11)
    # Some Unicies need explicit linkage to the Math library or the build fails.
    IF(NOT APPLE) << --- change
        FIND_LIBRARY(MATH_LIBRARY m)
    ENDIF(NOT APPLE)  <<--- change
ENDIF(UNIX)
....

Apple doesn't really have "libm" but rather has 2 symlinks:

........
  [j...@mac]:/usr/lib dir libm.*
  lrwxr-xr-x 1 root wheel 15 Apr 12  2009 libm.dylib -> libSystem.dylib

  [j...@mac]:/Developer/SDKs/MacOSX10.4u.sdk/usr/lib dir libm.dylib
  lrwxr-xr-x 1 root wheel 15 Aug 16 18:49 libm.dylib -> libSystem.dylib
........

So, for libm, OSG has been linking the "UNIX way" but not the "Apple way"
(since UNIX includes APPLE on cmake).

The question is if this change would break compiling
on other Apple configurations (Leopard/SnowLeopard) ??


............................................................................


Linking CXX shared library ../../lib/libosgText.dylib
cd /Users/jimb/tmp/OpenSceneGraph-2.8.2-squareBracketFix-appleMacFix/src/osgText
 && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/osgText.dir/link.txt --
verbose=1
/usr/bin/c++   -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-vers
ion-min=10.4 -O2  -mmacosx-version-min=10.4 -ftree-vectorize -fvisibility-inline
s-hidden -dynamiclib -headerpad_max_install_names -compatibility_version 55.0.0
-current_version 2.8.2 -o ../../lib/libosgText.2.8.2.dylib -install_name /Users/
jimb/tmp/OpenSceneGraph-2.8.2-squareBracketFix-appleMacFix/lib/libosgText.55.dyl
ib CMakeFiles/osgText.dir/DefaultFont.cpp.o CMakeFiles/osgText.dir/Font.cpp.o CM
akeFiles/osgText.dir/Font3D.cpp.o CMakeFiles/osgText.dir/String.cpp.o CMakeFiles
/osgText.dir/FadeText.cpp.o CMakeFiles/osgText.dir/TextBase.cpp.o CMakeFiles/osg
Text.dir/Text.cpp.o CMakeFiles/osgText.dir/Text3D.cpp.o
CMakeFiles/osgText.dir/Version.cpp.o ../../lib/libosgDB.2.8.2.dylib
../../lib/libosg.2.8.2.dylib ../../lib/libOpenThreads.2.4.0.dylib -framework AGL
-framework OpenGL /usr/lib/libm.dylib
-lpthread -framework Carbon -framework AGL -framework OpenGL
ld: Undefined symbols:
_acl_copy_ext_native referenced from CarbonCore expected to be defined in libSys
tem
_acl_copy_int_native referenced from CarbonCore expected to be defined in libSys
tem
_task_name_for_pid referenced from CarbonCore expected to be defined in libSyste
m
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/libtool: internal link edit command
 failed
make[2]: *** [lib/libosgText.2.8.2.dylib] Error 1
make[1]: *** [src/osgText/CMakeFiles/osgText.dir/all] Error 2
make: *** [all] Error 2
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to