On Fri, Aug 5, 2011 at 9:57 AM, Alexander Hartner <[email protected]> wrote:
> Now when I import Logger.h and use it from a Objective C (.m) file everything 
> seems to work great. However as soon I as import it and use it from a 
> Objective C++ (.mm) file I get the following link error:
>
> Ld [REMOVED] normal i386
> setenv MACOSX_DEPLOYMENT_TARGET 10.4
> /Developer/usr/bin/g++-4.0 -arch i386 -dynamiclib -isysroot 
> /Developer/SDKs/MacOSX10.4u.sdk -L[REMOVED]/Release -F[REMOVED]/Release 
> -filelist [REMOVED].LinkFileList -install_name [REMOVED] 
> -mmacosx-version-min=10.4 -framework Foundation -framework Cocoa -framework 
> SyncServices -framework Foundation -framework IOKit -lcrypto.0.9.7 
> -lssl.0.9.7 -single_module -compatibility_version 1 -current_version 9 -o 
> [REMOVED]
>
> Undefined symbols:
>  "ABSLog(NSString*, ...)", referenced from:
>      -[SoapAdaptor initWithPreferences:] in SoapAdaptor.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status

http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3

Basically, the C++ compiler thinks ABSLog is a C++ function, and it's
undergoing name mangling. So what you have to do is tell the C++
compiler that ABSLog is a C function with extern "C" { stuff }
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to