Wenn ich versuche, etwas zu kompilieren, das CoreFoundation, CoreServices oder CoreGraphics enthält, z. B. Carbon, erhalte ich die folgende Fehlermeldung.Mac OSX Sierra CoreFoundation/CoreServices/CoreGraphics funktioniert nicht
gcc x.c -framework Carbon
In file included from /usr/include/Availability.h:180:0,
from /usr/local/Cellar/gcc/6.2.0/lib/gcc/6/gcc/x86_64-apple-darwin16.1.0/6.2.0/include-fixed/math.h:46,
from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:24,
from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19,
from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20,
from x.c:1:
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h:53:34: error: 'introduced' undeclared here (not in a function)
kCFISO8601DateFormatWithYear API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = (1UL << 0),
^
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:777:39: error: 'deprecated' undeclared here (not in a function)
const CFStringRef kCFURLLabelColorKey API_DEPRECATED("Use NSURLLabelColorKey", macosx(10.6, 10.12), ios(4.0, 10.0), watchos(2.0, 3.0), tvos(9.0, 10.0));
^
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:777:39: error: 'message' undeclared here (not in a function)
const CFStringRef kCFURLLabelColorKey API_DEPRECATED("Use NSURLLabelColorKey", macosx(10.6, 10.12), ios(4.0, 10.0), watchos(2.0, 3.0), tvos(9.0, 10.0));
^
In file included from /System/Library/Frameworks/Security.framework/Headers/Security.h:81:0,
from /System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentity.h:43,
from /System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OSServices.h:27,
from /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h:23,
from /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h:22,
from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:39,
from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20,
from x.c:1:
/System/Library/Frameworks/Security.framework/Headers/Authorization.h:194:7: error: variably modified 'bytes' at file scope
char bytes[kAuthorizationExternalFormLength];
^~~~~
In file included from /System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h:18:0,
from /System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h:9,
from /System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:11,
from /System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:35,
from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:24,
from x.c:1:
/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h:53:40: error: initializer element is not constant
static const CGFontIndex kCGGlyphMax = kCGFontIndexMax;
Hat jemand eine Idee, was das Problem sein könnte? Ich bin mir nicht sicher, ob dies nach der Aktualisierung auf Mac OS Sierra oder Xcode auf Version 8.1 begann. Edit: Das Programm scheint in Xcode, aber nicht im Terminal mit Homebrew gcc 6.2 zu kompilieren.
Ok, ich werde es versuchen! –
Ich habe versucht, in meine c-Datei zu #includieren und es bringt eine Menge Fehler mit sich. Ich habe auch versucht, mit -framework Foundation zu kompilieren, aber es scheint nicht zu helfen. Mache ich etwas falsch? –
@ Robert.S ja. Die Hauptsache, die Sie jetzt falsch machen, ist zu versuchen, C mit ObjC-only includes zu kompilieren. – hidefromkgb