Objective-C++ not compiling

閲覧: 69 回
最初の未読メッセージにスキップ

Leon McNeill

未読、
2015/04/20 4:26:162015/04/20
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

未読、
2015/04/23 23:15:592015/04/23
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

未読、
2015/04/27 5:20:152015/04/27
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

未読、
2015/04/30 22:57:132015/04/30
To: cocotr...@googlegroups.com
This has been fixed in master.
全員に返信
投稿者に返信
転送
新着メール 0 件