7
什麼會導致類似這樣的錯誤?我向Xcode添加了一個空項目,在Header Search Paths中添加了/ usr/local/lib,並添加了一些opencv庫。建築給了這些錯誤:cstdint中的錯誤:全局命名空間中沒有名爲xxx的成員
UPDATE
看來stdint.h是我的系統上安裝確實。我在OS 10.9上運行,因此xcode在全局名稱空間中找不到的類型如int_least16_t
似乎已被定義。
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
您是否也啓用了C++ 11支持? – lpapp
是的,我正在使用的C++標準庫是libC++(支持C++ 11的LLVM C++標準庫)。我也使用C++語言方言GNU ++ 11。使用方言C++ 11時會發生同樣的錯誤。我確信我使用的編譯器(Apple LLVM 5.1)確實正在使用這些選項。 –
您是否確認過您的系統中已安裝'stdint.h',並且這些類型是在其內部聲明的? 「 – Amadeus