[英]Errors in cstdint: No member named xxx in global namespace
什么會導致這樣的錯誤? 我向Xcode添加了一個空項目,在Header Search Paths中添加了/ usr / local / lib,並添加了一些opencv庫。 Building出現了這些錯誤:
UPDATE
看來stdint.h確實安裝在我的系統上。 我正在OS 10.9上運行,所以類似int_least16_t
這樣的類型,xcode在全局命名空間中找不到,似乎是定義的。
typedef int16_t int_least16_t;
。
find /Applications/Xcode.app -name stdint.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/include/c++/4.2.1/tr1/stdint.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/include/stdint.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/usr/include/c++/4.2.1/tr1/stdint.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/usr/include/stdint.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/stdint.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/tr1/stdint.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/stdint.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/stdint.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1/tr1/stdint.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/stdint.h
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/5.1/include/stdint.h
感謝@nm,我了解到直接在/usr/local
下安裝任何東西都會因為隨后的版本地獄而被打破。 我可能在/usr/local/include
有一些不良的來源,所以當我用/usr/local/Cellar/opencv/2.4.8.2/include/opencv2
替換usr/local/include
時(因為我使用brew安裝了opencv)在Xcode > Build Settings > Header Search Paths
(使用遞歸True)一切正常。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.