Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Problems compiling a library
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Guandalug" data-source="post: 759446" data-attributes="member: 74727"><p>I have a strange problem compiling a universal binary .dylib - or rather, the PPC-part of it. </p><p></p><p>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.</p><p></p><p>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..... </p><p></p><p>So, let's get the example code and error message:</p><p>[CODE]#include <list></p><p></p><p>typedef std::list<int> proList;</p><p></p><p>proList profiles;[/CODE]</p><p></p><p>Not much there to look at - but it's enough to trigger the following message:</p><p></p><p>[CODE]Checking Dependencies</p><p>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</p><p> cd /Users/guandalug/transfer/guanRenderSetupStorage</p><p> setenv MACOSX_DEPLOYMENT_TARGET 10.3</p><p> setenv NEXT_ROOT /Developer/SDKs/MacOSX10.3.9.sdk</p><p> /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</p><p></p><p>Ld /Users/guandalug/transfer/guanRenderSetupStorage/build/guanRenderSetupStorage.build/Release/guanRenderSetupStorage.build/Objects-normal/ppc/guanRenderSetupStorage.dylib normal ppc</p><p> cd /Users/guandalug/transfer/guanRenderSetupStorage</p><p> setenv MACOSX_DEPLOYMENT_TARGET 10.3</p><p> setenv NEXT_ROOT /Developer/SDKs/MacOSX10.3.9.sdk</p><p> /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</p><p>/usr/bin/libtool: NEXT_ROOT environment variable ignored because -syslibroot specified</p><p>ld: Undefined symbols:</p><p>__ZNSt24__default_alloc_templateILb1ELi0EE10deallocateEPvm</p><p>__ZNSt24__default_alloc_templateILb1ELi0EE8allocateEm</p><p>/usr/bin/libtool: internal link edit command failed</p><p>[/CODE]</p><p></p><p>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.</p><p></p><p>I bet the error's simple - I just don't know where to look any more. Any hint is welcome. </p><p></p><p>(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)</p></blockquote><p></p>
[QUOTE="Guandalug, post: 759446, member: 74727"] 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;[/CODE] 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 [/CODE] 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) [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Problems compiling a library
Top