Mavericks Compile Error

BlitzMax Forums/BlitzMax Programming/Mavericks Compile Error

JoshK(Posted 2014) [#1]
Trying to build modules on OSX Mavericks (10.9):
Building Modules
Compiling:blitz_app.c
Compiling:blitz_types.c
Compiling:blitz_cclib.c
Compiling:blitz_memory.c
Compiling:blitz_module.c
Compiling:blitz_object.c
Compiling:blitz_string.c
Compiling:blitz_array.c
Compiling:blitz_handle.c
Compiling:blitz_debug.c
Compiling:blitz_incbin.c
Compiling:blitz_thread.c
Compiling:blitz_ex.c
Compiling:blitz_gc.c
Compiling:blitz_gc_rc.c
Compiling:blitz_ex.macos.x86.s
Compiling:blitz_gc.macos.x86.s
Compiling:blitz_ftoi.macos.x86.s
Compiling:blitz.bmx
Archiving:blitz.debug.macos.x86.a
Compiling:debugger_mt.stdio.bmx
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Applications/BlitzMax/mod/brl.mod/blitz.mod/.bmx/blitz_gc.c.debug.macos.x86.o has no symbols
Compiling:appstub.macos.m
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:161,
                 from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:10,
                 from /Applications/BlitzMax/mod/brl.mod/appstub.mod/appstub.macos.m:4:
/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h:16: error: expected ',' or '}' before '__attribute__'
Build Error: failed to compile /Applications/BlitzMax/mod/brl.mod/appstub.mod/appstub.macos.m
Process complete

I have Xcode 4.6.2 and command-line tools installed.


Yasha(Posted 2014) [#2]
Just a guess, but what's your GCC version? Is the gcc command finding the real thing instead of (as it should) Clang?

Clang allows attributes on enumerators as an extension to GCC allowed syntax: http://clang.llvm.org/docs/LanguageExtensions.html#attributes-on-enumerators

If you have up-to-date header files designed for Clang, but BlitzMax is finding an old version of GCC from before your Xcode updates, that's one thing that might explain such an error.


JoshK(Posted 2014) [#3]
No GCC or G++ info shows up in the About dialog.


Yasha(Posted 2014) [#4]
You can get this info by running 'gcc -v' in the terminal. The output should say something about Clang (because the gcc command should be set up to redirect to Clang).


dawlane(Posted 2014) [#5]
Whats the base OSX SDK? You should consider using XCode 5.


Brucey(Posted 2014) [#6]
$ ./bmk -v
bmk 2.16 mt-macos-x86 / clang 500.2.79 (cpu x4)

gcc is clang here on Mavericks.


JoshK(Posted 2014) [#7]
Josh-Klints-iMac:~ jklint$ gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Josh-Klints-iMac:~ jklint$ 



Yasha(Posted 2014) [#8]
Yeah so you're still using a real GCC (LLVM-GCC isn't Clang: it has the same backend but the frontend, which is what's rejecting the header, is still the original). This should, with luck, resolve itself automatically if you can update to Xcode 5.

GCC is deprecated from Xcode 5/Mavericks onwards. (Turns out that's when they made the changeover; it's not something actually wrong with your installation.)