Objective-C++ not compiling

63 views
Skip to first unread message

Leon McNeill

unread,
Apr 20, 2015, 4:26:16 AM4/20/15
to cocotr...@googlegroups.com

I can’t seem to get CDT compiling Objective-C++.  As soon as I rename my skeletal source from .m to .mm, compilation chokes like this:

In file included from /Developer/Cocotron/1.0/Windows/i386/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:9,
                 from /Developer/Cocotron/1.0/Windows/i386/Frameworks/Foundation.framework/Headers/NSObject.h:9,
                 from /Developer/Cocotron/1.0/Windows/i386/Frameworks/Foundation.framework/Headers/NSGeometry.h:9,
                 from /Developer/Cocotron/1.0/Windows/i386/Frameworks/Foundation.framework/Headers/NSAffineTransform.h:9,
                 from /Developer/Cocotron/1.0/Windows/i386/Frameworks/Foundation.framework/Headers/Foundation.h:41,
                 from /Users/leon/Dev/Projects/Zorak/Zorak/TagShagger/General/../../../../Other/Shared/Music/iTunesInterface_win.h:1,
                 from /Users/leon/Dev/Projects/Zorak/Zorak/TagShagger/General/../../../../Other/Shared/Music/iTunesInterface_win.mm:4:
/Developer/Cocotron/1.0/Windows/i386/Frameworks/objc.framework/Headers/objc.h:26: error: expected constructor, destructor, or type conversion before 'const'

In file included from /Developer/Cocotron/1.0/Windows/i386/Frameworks/Foundation.framework/Headers/NSZone.h:9,
                 from /Developer/Cocotron/1.0/Windows/i386/Frameworks/Foundation.framework/Headers/NSObject.h:10,
                 from /Developer/Cocotron/1.0/Windows/i386/Frameworks/Foundation.framework/Headers/NSGeometry.h:9,
                 from /Developer/Cocotron/1.0/Windows/i386/Frameworks/Foundation.framework/Headers/NSAffineTransform.h:9,
                 from /Developer/Cocotron/1.0/Windows/i386/Frameworks/Foundation.framework/Headers/Foundation.h:41,
                 from /Users/leon/Dev/Projects/Zorak/Zorak/TagShagger/General/../../../../Other/Shared/Music/iTunesInterface_win.h:1,
                 from /Users/leon/Dev/Projects/Zorak/Zorak/TagShagger/General/../../../../Other/Shared/Music/iTunesInterface_win.mm:4:
/Developer/Cocotron/1.0/Windows/i386/Frameworks/objc.framework/Headers/runtime.h:10: error: 'OBJC_WINDOWS_DLLIMPORT' does not name a type

For what it's worth, here's the compile invocation that resulted in the above:

CompileC /Users/leon/Builds/TagShagger-aekbogurgbpuboavhjwibqrzugxq/Build/Intermediates/TagShagger.build/Release/Zorak-Win.build/Objects-normal/i386/iTunesInterface_win.o General/../../../../Other/Shared/Music/iTunesInterface_win.mm normal i386 objective-c++ org.cocotron.1.0.windows.i386.gcc.4.3.1

 cd /Users/leon/Dev/Projects/Zorak/Zorak/TagShagger

 setenv LANG en_US.US-ASCII

 /Developer/Cocotron/1.0/Windows/i386/gcc-4.3.1/bin/i386-mingw32msvc-gcc -x objective-c++ -fmessage-length=0 -pipe -Wno-trigraphs -Os -Wreturn-type -Wunused-variable -DEXPIRINGBETA=0 -DISZorak=1 -gdwarf-2 -fvisibility=hidden -fvisibility-inlines-hidden -F/Developer/Cocotron/1.0/Windows/i386/Frameworks -D__COCOTRON__ -DWINDOWS -fconstant-string-class=NSConstantString -I/Users/leon/Dev/Shared -I/Users/leon/Builds/TagShagger-aekbogurgbpuboavhjwibqrzugxq/Build/Products/Release/include -I. -Ibuild -IexpatCocoa -IGeneral -IImages -IMain -IZorak.help -IScript-Misc -IScripts -ITags -ITasks -Ibuild/TagShagger.build -IImages/Menu -IZorak.help/Contents -Ibuild/TagShagger.build/Debug -IZorak.help/Contents/Resources "-Ibuild/TagShagger.build/Debug/Zorak App Store.build" -IZorak.help/Contents/Resources/shared "-Ibuild/TagShagger.build/Debug/Zorak App Store.build/Objects-normal" "-Ibuild/TagShagger.build/Debug/Zorak App Store.build/Objects-normal/x86_64" -I/Developer/Cocotron/1.0/Windows/i386/gcc-4.3.1/i386-mingw32msvc/sys-include -I/Users/leon/Dev/Projects/Other/Shared/Music -I/Users/leon/Dev/Projects/Other/Shared/Other -I/Users/leon/Dev/Projects/Other/Shared/Localization -I/Users/leon/Builds/TagShagger-aekbogurgbpuboavhjwibqrzugxq/Build/Intermediates/TagShagger.build/Release/Zorak-Win.build/DerivedSources/i386 -I/Users/leon/Builds/TagShagger-aekbogurgbpuboavhjwibqrzugxq/Build/Intermediates/TagShagger.build/Release/Zorak-Win.build/DerivedSources -Wall -Wno-unknown-pragmas -F/Users/leon/Builds/TagShagger-aekbogurgbpuboavhjwibqrzugxq/Build/Products/Release -F/Developer/Cocotron/1.0/Windows/i386/Frameworks -include /Users/leon/Dev/Projects/Zorak/Zorak/TagShagger/TagShagger_Prefix.pch -c /Users/leon/Dev/Projects/Zorak/Zorak/TagShagger/General/../../../../Other/Shared/Music/iTunesInterface_win.mm -o /Users/leon/Builds/TagShagger-aekbogurgbpuboavhjwibqrzugxq/Build/Intermediates/TagShagger.build/Release/Zorak-Win.build/Objects-normal/i386/iTunesInterface_win.o

Any thoughts?  Thanks in advance.
Leon

Christopher Lloyd

unread,
Apr 23, 2015, 11:15:59 PM4/23/15
to cocotr...@googlegroups.com
Hi, looks like there is a mistake in the objc-export.h header.

this:

#if defined(OBJC_INSIDE_BUILD)

#define OBJC_EXPORT extern "C" OBJC_WINDOWS_DLLEXPORT

#else

#define OBJC_EXPORT extern "C" OBJC_WINDOWS_DLLIMPORT 

#endif

#else

#define OBJC_EXPORT extern "C"

#endif


should be:

#if defined(OBJC_INSIDE_BUILD)

#define OBJC_EXPORT extern "C" OBJC_DLLEXPORT

#else

#define OBJC_EXPORT extern "C" OBJC_DLLIMPORT 

#endif

#else

#define OBJC_EXPORT extern "C"

#endif

Leon McNeill

unread,
Apr 27, 2015, 5:20:15 AM4/27/15
to cocotr...@googlegroups.com
That fixed it!  Until this change is committed to master, this information may be useful for other people.

Thanks!

Christopher Lloyd

unread,
Apr 30, 2015, 10:57:13 PM4/30/15
to cocotr...@googlegroups.com
This has been fixed in master.
Reply all
Reply to author
Forward
0 new messages