Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS Yosemite for iOS 8.1上的C代码编译失败_Ios_C_Swift_Llvm_Osx Yosemite - Fatal编程技术网

iOS Yosemite for iOS 8.1上的C代码编译失败

iOS Yosemite for iOS 8.1上的C代码编译失败,ios,c,swift,llvm,osx-yosemite,Ios,C,Swift,Llvm,Osx Yosemite,在我的应用程序中尝试使用C代码时,我遇到了一个奇怪的编译错误。错误如下: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/include/os/activity.h:38:9: error: declaration of 'uint64_t' must be imported from module 'Ma

在我的应用程序中尝试使用C代码时,我遇到了一个奇怪的编译错误。错误如下:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/include/os/activity.h:38:9: error: declaration of 'uint64_t' must be imported from module 'MachO.arch' before it is required
typedef uint64_t os_activity_t;
完成问题的编译器输出:

compileSwift normal x86_64 /Users/dan/dev/myapp-2-mirror/ios/myapp/AppDelegate.swift
    cd /Users/dan/dev/myapp-2-mirror/ios
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/dan/dev/myapp-2-mirror/ios/myapp/ViewController.swift -primary-file /Users/dan/dev/myapp-2-mirror/ios/myapp/AppDelegate.swift -target x86_64-apple-ios8.1 -target-cpu core2 -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -I /Users/dan/Library/Developer/Xcode/DerivedData/myapp-gmwstsbfdcwhlzdgtdnbfrycgaic/Build/Products/Debug-iphonesimulator -F /Users/dan/Library/Developer/Xcode/DerivedData/myapp-gmwstsbfdcwhlzdgtdnbfrycgaic/Build/Products/Debug-iphonesimulator -g -import-objc-header /Users/dan/dev/myapp-2-mirror/ios/myapp/myapp-Bridging-Header.h -module-cache-path /Users/dan/Library/Developer/Xcode/DerivedData/ModuleCache -Xcc -I/Users/dan/Library/Developer/Xcode/DerivedData/myapp-gmwstsbfdcwhlzdgtdnbfrycgaic/Build/Intermediates/myapp.build/Debug-iphonesimulator/myapp.build/swift-overrides.hmap -Xcc -I/Users/dan/Library/Developer/Xcode/DerivedData/myapp-gmwstsbfdcwhlzdgtdnbfrycgaic/Build/Intermediates/myapp.build/Debug-iphonesimulator/myapp.build/myapp.hmap -Xcc -I/Users/dan/Library/Developer/Xcode/DerivedData/myapp-gmwstsbfdcwhlzdgtdnbfrycgaic/Build/Products/Debug-iphonesimulator/include -Xcc -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++ -Xcc -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -Xcc -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/experimental -Xcc -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ext -Xcc -I../native_lib/source/coreapi -Xcc -I../native_lib/source/native_lib -Xcc -I../native_lib/source/native_lib/include -Xcc -I../native_lib/source/native_lib/src -Xcc -I../native_lib/source/native_lib/tools -Xcc -I../native_lib/source/native_lib/include/common -Xcc -I../native_lib/source/native_lib/include/native_lib -Xcc -I../native_lib/source/native_lib/include/services -Xcc -I../native_lib/source/native_lib/include/ssh -Xcc -I../native_lib/source/native_lib/include/ssl -Xcc -I../native_lib/source/native_lib/src/common -Xcc -I../native_lib/source/native_lib/src/services -Xcc -I../native_lib/source/native_lib/src/ssh -Xcc -I../native_lib/source/native_lib/src/ssl -Xcc -I../native_lib/source/native_lib/tools/rsa4php -Xcc -I../native_lib/source/native_lib/include/services/audio -Xcc -I../native_lib/source/native_lib/include/services/bignum -Xcc -I../native_lib/source/native_lib/include/services/ciphers -Xcc -I../native_lib/source/native_lib/src/services/audio -Xcc -I../native_lib/source/native_lib/src/services/bignum -Xcc -I../native_lib/source/native_lib/src/services/ciphers -Xcc -I../native_lib/source/native_lib/include/services/audio/common -Xcc -I../native_lib/source/native_lib/src/services/audio/common -Xcc -I../native_lib/source/native_lib/src/services/audio/g711 -Xcc -I../native_lib/source/native_lib/src/services/audio/g729ab -Xcc -I../native_lib/source/native_lib/src/services/audio/multicodec -Xcc -I../native_lib/source/native_lib/src/services/audio/spirit -Xcc -I/Users/dan/Library/Developer/Xcode/DerivedData/myapp-gmwstsbfdcwhlzdgtdnbfrycgaic/Build/Intermediates/myapp.build/Debug-iphonesimulator/myapp.build/DerivedSources/x86_64 -Xcc -I/Users/dan/Library/Developer/Xcode/DerivedData/myapp-gmwstsbfdcwhlzdgtdnbfrycgaic/Build/Intermediates/myapp.build/Debug-iphonesimulator/myapp.build/DerivedSources -Xcc -DDEBUG=1 -emit-module-doc-path /Users/dan/Library/Developer/Xcode/DerivedData/myapp-gmwstsbfdcwhlzdgtdnbfrycgaic/Build/Intermediates/myapp.build/Debug-iphonesimulator/myapp.build/Objects-normal/x86_64/AppDelegate~partial.swiftdoc -Onone -module-name myapp -emit-module-path /Users/dan/Library/Developer/Xcode/DerivedData/myapp-gmwstsbfdcwhlzdgtdnbfrycgaic/Build/Intermediates/myapp.build/Debug-iphonesimulator/myapp.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule -serialize-diagnostics-path /Users/dan/Library/Developer/Xcode/DerivedData/myapp-gmwstsbfdcwhlzdgtdnbfrycgaic/Build/Intermediates/myapp.build/Debug-iphonesimulator/myapp.build/Objects-normal/x86_64/AppDelegate.dia -emit-dependencies-path /Users/dan/Library/Developer/Xcode/DerivedData/myapp-gmwstsbfdcwhlzdgtdnbfrycgaic/Build/Intermediates/myapp.build/Debug-iphonesimulator/myapp.build/Objects-normal/x86_64/AppDelegate.d -o /Users/dan/Library/Developer/Xcode/DerivedData/myapp-gmwstsbfdcwhlzdgtdnbfrycgaic/Build/Intermediates/myapp.build/Debug-iphonesimulator/myapp.build/Objects-normal/x86_64/AppDelegate.o

/Users/dan/dev/myapp-2-mirror/ios/myapp/myappDataIOS.h:11:9: note: while building module 'Foundation' imported from /Users/dan/dev/myapp-2-mirror/ios/myapp/myappDataIOS.h:11:
#import <Foundation/Foundation.h>
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: note: while building module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
#include <CoreFoundation/CoreFoundation.h>
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15:10: note: while building module 'Dispatch' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15:
#include <dispatch/dispatch.h>
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/include/dispatch/dispatch.h:48:10: note: while building module 'os' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/include/dispatch/dispatch.h:48:
#include <os/object.h>
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/include/os/activity.h:38:9: error: declaration of 'uint64_t' must be imported from module 'MachO.arch' before it is required
typedef uint64_t os_activity_t;
        ^
/Users/dan/dev/myapp-2-mirror/ios/../native_lib/source/native_lib/include/common/stdint.h:101:32: note: previous declaration is here
typedef unsigned long long     uint64_t;
                               ^
/Users/dan/dev/myapp-2-mirror/ios/myapp/myappDataIOS.h:11:9: note: while building module 'Foundation' imported from /Users/dan/dev/myapp-2-mirror/ios/myapp/myappDataIOS.h:11:
#import <Foundation/Foundation.h>
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: note: while building module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
#include <CoreFoundation/CoreFoundation.h>
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15:10: note: while building module 'Dispatch' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15:
#include <dispatch/dispatch.h>
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/include/dispatch/dispatch.h:48:10: error: could not build module 'os'
#include <os/object.h>
         ^
/Users/dan/dev/myapp-2-mirror/ios/myapp/myappDataIOS.h:11:9: note: while building module 'Foundation' imported from /Users/dan/dev/myapp-2-mirror/ios/myapp/myappDataIOS.h:11:
#import <Foundation/Foundation.h>
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: note: while building module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
#include <CoreFoundation/CoreFoundation.h>
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:55:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:55:
#include <CoreFoundation/CFPropertyList.h>
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:13:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:13:
#include <CoreFoundation/CFStream.h>
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15:10: error: could not build module 'Dispatch'
#include <dispatch/dispatch.h>
         ^
/Users/dan/dev/myapp-2-mirror/ios/myapp/myappDataIOS.h:11:9: note: while building module 'Foundation' imported from /Users/dan/dev/myapp-2-mirror/ios/myapp/myappDataIOS.h:11:
#import <Foundation/Foundation.h>
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: error: could not build module 'CoreFoundation'
#include <CoreFoundation/CoreFoundation.h>
         ^
/Users/dan/dev/myapp-2-mirror/ios/myapp/myappDataIOS.h:11:9: note: while building module 'Foundation' imported from /Users/dan/dev/myapp-2-mirror/ios/myapp/myappDataIOS.h:11:
#import <Foundation/Foundation.h>
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:9:9: note: while building module 'Security' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:9:
#import <Security/Security.h>
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h:25:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h:25:
#include <Security/SecCertificate.h>
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h:38:10: error: could not build module 'CoreFoundation'
#include <CoreFoundation/CFData.h>
         ^
/Users/dan/dev/myapp-2-mirror/ios/myapp/myappDataIOS.h:11:9: note: while building module 'Foundation' imported from /Users/dan/dev/myapp-2-mirror/ios/myapp/myappDataIOS.h:11:
#import <Foundation/Foundation.h>
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:10:9: note: while building module 'CFNetwork' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:10:
#import <CFNetwork/CFNetwork.h>
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h:18:10: error: could not build module 'CoreFoundation'
#include <CoreFoundation/CoreFoundation.h>
         ^
/Users/dan/dev/myapp-2-mirror/ios/myapp/myapp-Bridging-Header.h:5:9: note: in file included from /Users/dan/dev/myapp-2-mirror/ios/myapp/myapp-Bridging-Header.h:5:
#import "myappDataIOS.h"
        ^
/Users/dan/dev/myapp-2-mirror/ios/myapp/myappDataIOS.h:11:9: error: could not build module 'Foundation'
#import <Foundation/Foundation.h>
        ^
/Users/dan/dev/myapp-2-mirror/ios/myapp/myapp-Bridging-Header.h:5:9: note: in file included from /Users/dan/dev/myapp-2-mirror/ios/myapp/myapp-Bridging-Header.h:5:
#import "myappDataIOS.h"
        ^
/Users/dan/dev/myapp-2-mirror/ios/myapp/myappDataIOS.h:13:30: error: cannot find interface declaration for 'NSObject', superclass of 'myappData'
@interface myappData : NSObject
                             ^
<unknown>:0: error: failed to import bridging header '/Users/dan/dev/myapp-2-mirror/ios/myapp/myapp-Bridging-Header.h'

我怀疑与我的uint64\u t类型发生冲突,但我如何才能消除它?

删除任何与uint64\u t相关的typedef,如果您没有这样做,则包括在内,以查看发生了什么。根据文档,“导入”不受很好的支持,并且充满了bug。我的建议是:将所有“导入”替换为“包含”,并在每个头文件中使用适当的“ifdef”包装器。