Results 1 to 3 of 3
  1. #1
    Problems compiling a library

    Member Since
    Nov 19, 2008
    Posts
    3
    Question Problems compiling a library
    I have a strange problem compiling a universal binary .dylib - or rather, the PPC-part of it.

    Now, I have a G4 PPC machine running 10.4.11 here, and set up XCode (2.5) to use GCC 3.3 with the 10.3.9 - SDK for the PPC tree and GCC 4.0 with the 10.4u SDK for the intel architecture. This setup works fine for most libraries I created - but as soon as I use ANY STL-container (vector, list, ...) I get a strange error on linking about undefined symbols in the PPC compile run - the intel - run works flawlessly.

    The strange thing? If I take the same code (and XCode project) and compile it on a friend's Mac (Intel-based, also 10.4, XCode 2.5), BOTH parts of the lib come up clean. Now that's no solution, of course.....

    So, let's get the example code and error message:
    Code:
    #include <list>
    
    typedef std::list<int> proList;
    
    proList profiles;
    Not much there to look at - but it's enough to trigger the following message:

    Code:
    Checking Dependencies
    CompileC build/guanRenderSetupStorage.build/Release/guanRenderSetupStorage.build/Objects-normal/ppc/pluginmain.o /Users/guandalug/transfer/guanRenderSetupStorage/pluginmain.cpp normal ppc c++ com.apple.compilers.gcc.3_3
        cd /Users/guandalug/transfer/guanRenderSetupStorage
        setenv MACOSX_DEPLOYMENT_TARGET 10.3
        setenv NEXT_ROOT /Developer/SDKs/MacOSX10.3.9.sdk
        /usr/bin/gcc-3.3 -x c++ -arch ppc -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -Os -Wreturn-type -Wunused-variable -fmessage-length=0 -mtune=G5 -Wp,-header-mapfile,/Users/guandalug/transfer/guanRenderSetupStorage/build/guanRenderSetupStorage.build/Release/guanRenderSetupStorage.build/guanRenderSetupStorage.hmap -F/Users/guandalug/transfer/guanRenderSetupStorage/build/Release -I/Users/guandalug/transfer/guanRenderSetupStorage/build/Release/include -I/Applications/DAZStudio/sdk/include -I/Users/guandalug/transfer/guanRenderSetupStorage/build/guanRenderSetupStorage.build/Release/guanRenderSetupStorage.build/DerivedSources -DMAC_OS_X_VERSION_MIN_REQUIRED=1030 -fconstant-cfstrings -D__CONSTANT_CFSTRINGS__ -isystem /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/gcc/darwin/3.3 -I/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/gcc/darwin/3.3/c++ -I/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/gcc/darwin/3.3/c++/ppc-darwin -isystem /Developer/SDKs/MacOSX10.3.9.sdk/usr/include -include /Library/Caches/com.apple.Xcode.501/SharedPrecompiledHeaders/guanRenderSetupStorage_Prefix-fipnmkgkdczsvmhhzdyrgrqyokjw/guanRenderSetupStorage_Prefix.pch -c /Users/guandalug/transfer/guanRenderSetupStorage/pluginmain.cpp -o /Users/guandalug/transfer/guanRenderSetupStorage/build/guanRenderSetupStorage.build/Release/guanRenderSetupStorage.build/Objects-normal/ppc/pluginmain.o
    
    Ld /Users/guandalug/transfer/guanRenderSetupStorage/build/guanRenderSetupStorage.build/Release/guanRenderSetupStorage.build/Objects-normal/ppc/guanRenderSetupStorage.dylib normal ppc
        cd /Users/guandalug/transfer/guanRenderSetupStorage
        setenv MACOSX_DEPLOYMENT_TARGET 10.3
        setenv NEXT_ROOT /Developer/SDKs/MacOSX10.3.9.sdk
        /usr/bin/g++-3.3 -o /Users/guandalug/transfer/guanRenderSetupStorage/build/guanRenderSetupStorage.build/Release/guanRenderSetupStorage.build/Objects-normal/ppc/guanRenderSetupStorage.dylib -L/Users/guandalug/transfer/guanRenderSetupStorage/build/Release -L/Applications/DAZStudio/sdk/lib -L/Developer/SDKs/MacOSX10.3.9.sdk/usr/lib/gcc/darwin/3.3 -F/Users/guandalug/transfer/guanRenderSetupStorage/build/Release -filelist /Users/guandalug/transfer/guanRenderSetupStorage/build/guanRenderSetupStorage.build/Release/guanRenderSetupStorage.build/Objects-normal/ppc/guanRenderSetupStorage.LinkFileList -arch ppc -Wl,-single_module -compatibility_version 1 -current_version 1 -install_name /usr/local/lib/guanRenderSetupStorage.dylib -dynamiclib -mmacosx-version-min=10.3 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.3.9.sdk
    /usr/bin/libtool: NEXT_ROOT environment variable ignored because -syslibroot specified
    ld: Undefined symbols:
    __ZNSt24__default_alloc_templateILb1ELi0EE10deallocateEPvm
    __ZNSt24__default_alloc_templateILb1ELi0EE8allocateEm
    /usr/bin/libtool: internal link edit command failed
    And no, it's not additional libs - I disabled ALL external libs in XCode, compiled (the File list only contained the single .o file), and still the error stays.

    I bet the error's simple - I just don't know where to look any more. Any hint is welcome.

    (Yes, the final lib should be and is more than just the few lines, I already boiled it down to those lines as cause or at least best explanation of the bug. The lib also compiles if I drop the STL container from it, but that shouldn't be the solution either)

  2. #2
    Problems compiling a library

    Member Since
    Nov 19, 2008
    Posts
    3
    Additional information: The two symbols mentioned resolve to:

    Code:
    std::__default_alloc_template<true, 0>::deallocate(void*, unsigned long): 0
    and
    Code:
    std::__default_alloc_template<true, 0>::allocate(unsigned long): 0
    Not that THIS enlightens me a lot..... any hints where I should look?

  3. #3
    Problems compiling a library

    Member Since
    Nov 19, 2008
    Posts
    3
    I found a "Workaround" for now. After trying to use GCC 4.0 instead of 3.3 for the PPC compile (which failed because one of the project libraries I have to use are not GCC4 - compatible), I switches from STL std::list to QTs QValueList. Not a change I really welcome, but it solves the immediate problem. I now assume there's something fishy with my GCC 3.3 in combination with the SDK 10.3.9.

    Ah well, it compiles now.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. iTunes LIbrary Problems
    By starrykitten in forum Music, Audio, and Podcasting
    Replies: 3
    Last Post: 06-26-2012, 08:35 PM
  2. iPhoto Library Problems
    By IndyBob in forum Images, Graphic Design, and Digital Photography
    Replies: 3
    Last Post: 01-08-2012, 04:57 AM
  3. Problems installing FFTW3 Library
    By cturnes in forum OS X - Operating System
    Replies: 0
    Last Post: 06-03-2010, 12:07 AM
  4. iphoto library problems! Help Please.
    By mikejk in forum OS X - Operating System
    Replies: 1
    Last Post: 01-10-2010, 04:09 AM
  5. Problems with terminal SSH compiling.
    By monolith in forum OS X - Development and Darwin
    Replies: 7
    Last Post: 01-16-2009, 11:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •