![]() This allows enumerators to be deprecated, made unavailable, etc. Update 2: It is a documented Clang extension:Ĭlang allows attributes to be written on individual enumerators. The quickest way to get GCC on the M1/M2 ARM based Mac is using brew. I don't want to patch SDK headers, so looks like this is a no-go. Update 1: OS X's headers apply _attribute_((weak_import)) to an individual enumeration type, and GCC apparently doesn't support this:įor an enum, struct or union type, you may specify attributes either between the enum, struct or union tag and the name of the type, or just past the closing curly brace of the definition. My end goal is to compile a full program (Qt gui) for 10.6 that uses C++11 features, so GCC is a must as 10.6 doesn't have libc++. Is the MacPorts GCC borked or is this an issue with GCC and OS X headers? It still doesn't work (although it gives errors relative to the SDK). NSUserNotificationActivationTypeReplied NS_AVAILABLE(10_9, NA) = 3Įven if I add the -isysroot arg like so: -isysroot `xcodebuild -version -sdk macosx Path` System/Library/Frameworks/amework/Headers/NSUserNotification.h:16:45: error: expected ',' or '}' before '_attribute_' The error I receive is: In file included from /usr/include/Availability.h:148:0,įrom /opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/math.h:46,įrom /System/Library/Frameworks/amework/Headers/CoreFoundation.h:19,įrom /System/Library/Frameworks/amework/Headers/Foundation.h:6, Here's the command: g++-mp-4.8 objctest.m -mmacosx-version-min=10.8 -framework Foundation If I set the version to 10.9 or don't set it at all, it works. Before you install additional packages, you will need to make sure that you have installed the MacOS X Developer Tools (XCode) so that the gcc compiler is. ![]() I'm running 10.9.2 and installed GCC 4.8.2 through MacPorts ( sudo port install gcc48 +universal) and cannot compile Objective-C code that sets -mmacosx-version-min=10.8 or any other version and includes Foundation. Install gcc9 on macOS with MacPorts gcc9 v 9.5.0 Updated: 4 months, 1 week ago The GNU compiler collection The GNU compiler collection, including front ends for C, C++, Objective-C, Objective-C++ and Fortran. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |