XCode 3.0. Unresolved externals
Hi All! I've made launchd-enabled daemon with XCode 2.4, but with XCode 3.0 I get some unresolved externals. Should I add any framework to my project?
At 17:22 +0300 18/7/08, Vyacheslav Karamov wrote:
I've made launchd-enabled daemon with XCode 2.4, but with XCode 3.0 I get some unresolved externals.
What are the externals? All of the launchd specific symbols are in the System framework, which is added to your project by default.
$ nm /System/Library/Frameworks/System.framework/System | grep launch_msg 000380bf T _launch_msg 0003a6f3 t _launch_msg_getmsgs
S+E -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
/Developer/usr/bin/g++-4.0 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -L/Volumes/Untitled/Slavik/Projects/Mac/AudioServer/../build/Release -F/Volumes/Untitled/Slavik/Projects/Mac/AudioServer/../build/Release -filelist /Volumes/Untitled/Slavik/Projects/Mac/AudioServer/../build/AudioServer.build/Release/AudioServer.build/Objects-normal/ppc/AudioServer.LinkFileList -mmacosx-version-min=10.4 -framework CoreAudio /Volumes/Untitled/Slavik/Projects/Mac/build/Release/liboggstatic.a /Volumes/Untitled/Slavik/Projects/Mac/build/Release/libvorbisstatic.a /Volumes/Untitled/Slavik/Projects/Mac/build/Release/libTLSoundStatic.a -framework QuickTime -framework Foundation -framework Carbon -o /Volumes/Untitled/Slavik/Projects/Mac/AudioServer/../build/AudioServer.build/Release/AudioServer.build/Objects-normal/ppc/AudioServer Undefined symbols: "launch_data_dict_lookup(_launch_data*, char const*)", referenced from: _main in main.o "launch_data_get_type(_launch_data*)", referenced from: _main in main.o "launch_msg(_launch_data*)", referenced from: _main in main.o "launch_data_get_string(_launch_data*)", referenced from: _main in main.o "launch_data_free(_launch_data*)", referenced from: _main in main.o "launch_data_new_string(char const*)", referenced from: _main in main.o "launch_data_get_errno(_launch_data*)", referenced from: _main in main.o ld: symbol(s) not found collect2: ld returned 1 exit status Quinn wrote:
At 17:22 +0300 18/7/08, Vyacheslav Karamov wrote:
I've made launchd-enabled daemon with XCode 2.4, but with XCode 3.0 I get some unresolved externals.
What are the externals? All of the launchd specific symbols are in the System framework, which is added to your project by default.
$ nm /System/Library/Frameworks/System.framework/System | grep launch_msg 000380bf T _launch_msg 0003a6f3 t _launch_msg_getmsgs
S+E
I've "solved" :((((((((( this problem by changing "Target OS" from 10.4 to 10.5. Why? Why I have to? Vyacheslav Karamov wrote:
/Developer/usr/bin/g++-4.0 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -L/Volumes/Untitled/Slavik/Projects/Mac/AudioServer/../build/Release -F/Volumes/Untitled/Slavik/Projects/Mac/AudioServer/../build/Release -filelist /Volumes/Untitled/Slavik/Projects/Mac/AudioServer/../build/AudioServer.build/Release/AudioServer.build/Objects-normal/ppc/AudioServer.LinkFileList -mmacosx-version-min=10.4 -framework CoreAudio /Volumes/Untitled/Slavik/Projects/Mac/build/Release/liboggstatic.a /Volumes/Untitled/Slavik/Projects/Mac/build/Release/libvorbisstatic.a /Volumes/Untitled/Slavik/Projects/Mac/build/Release/libTLSoundStatic.a -framework QuickTime -framework Foundation -framework Carbon -o /Volumes/Untitled/Slavik/Projects/Mac/AudioServer/../build/AudioServer.build/Release/AudioServer.build/Objects-normal/ppc/AudioServer Undefined symbols: "launch_data_dict_lookup(_launch_data*, char const*)", referenced from: _main in main.o "launch_data_get_type(_launch_data*)", referenced from: _main in main.o "launch_msg(_launch_data*)", referenced from: _main in main.o "launch_data_get_string(_launch_data*)", referenced from: _main in main.o "launch_data_free(_launch_data*)", referenced from: _main in main.o "launch_data_new_string(char const*)", referenced from: _main in main.o "launch_data_get_errno(_launch_data*)", referenced from: _main in main.o ld: symbol(s) not found collect2: ld returned 1 exit status
Quinn wrote:
At 17:22 +0300 18/7/08, Vyacheslav Karamov wrote:
I've made launchd-enabled daemon with XCode 2.4, but with XCode 3.0 I get some unresolved externals.
What are the externals? All of the launchd specific symbols are in the System framework, which is added to your project by default.
$ nm /System/Library/Frameworks/System.framework/System | grep launch_msg 000380bf T _launch_msg 0003a6f3 t _launch_msg_getmsgs
S+E
At 15:18 +0300 21/7/08, Vyacheslav Karamov wrote:
I've "solved" :((((((((( this problem by changing "Target OS" from 10.4 to 10.5. Why? Why I have to?
This is because of a bug in the 10.4 SDK. In that SDK the "launch.h" file does not include the necessary stuff to prevent C++ name mangling of the launchd functions (the __BEGIN_DECLS and __END_DECLS macros). Thus, when you include the file from a C++ program, the names get mangled and the linker can't find them in the System framework. This bug is fixed in the 10.5 SDK. It's unlikely to ever be fixed in the 10.4 SDK because the 10.4 SDK is deliberately designed to reflect the state of the system at the time when 10.4 was released. You may be able to work around this problem by changing: #include <launch.h> to: extern "C" { #include <launch.h> }; S+E -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
participants (2)
-
Quinn
-
Vyacheslav Karamov