New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus • Advice and insight from world-class Apple enthusiasts • Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Problems compiling a library


Post Reply New Thread Subscribe

 
Thread Tools
Guandalug

 
Member Since: Nov 19, 2008
Posts: 3
Guandalug is on a distinguished road

Guandalug is offline
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)
QUOTE Thanks
Guandalug

 
Member Since: Nov 19, 2008
Posts: 3
Guandalug is on a distinguished road

Guandalug is offline
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?
QUOTE Thanks
Guandalug

 
Member Since: Nov 19, 2008
Posts: 3
Guandalug is on a distinguished road

Guandalug is offline
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.
QUOTE Thanks

Post Reply New Thread Subscribe


« question about objective C memory allocation | OBJECTIVE-C / COCOA MacOS Developer HOME BASED required by leading Company (VACANCY) »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Damaged iTunes Library mark campion iPod Hardware and Accessories 11 10-11-2013 10:59 PM
The Official "How To Transfer Your iPod or iTunes Library to Your New Mac" Thread TheCustomer99 iPod Hardware and Accessories 64 02-26-2013 02:39 PM
How to delete messed-up iPhoto Library? 24z Images, Graphic Design, and Digital Photography 3 02-04-2008 02:21 PM
Just How Secure Are the 'Reset Safari' & 'Erase Free Space' Facility? scoot OS X - Operating System 3 05-30-2007 05:28 PM
iphoto not loading photos from library lirrincity OS X - Apps and Games 5 01-31-2007 01:45 PM

All times are GMT -4. The time now is 09:36 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?