Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Errors in cstdint: No member named xxx in global namespace

Tags:

c++

macos

What can cause errors like these? I added an empty project to Xcode, added /usr/local/lib in the Header Search Paths, and added some opencv libraries. Building gave these errors:

UPDATE

It appears stdint.h is indeed installed on my system. I'm running on OS 10.9, so types like int_least16_t that xcode can't find in the global namespace do appear to be defined.

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
like image 285
Rose Perrone Avatar asked Apr 06 '14 03:04

Rose Perrone


1 Answers

Thanks to @n.m., I learned that installing anything directly under /usr/local is fundamentally broken because of the ensuing version hell. I likely had a some source of badness in /usr/local/include, so when I replaced usr/local/include with /usr/local/Cellar/opencv/2.4.8.2/include/opencv2 (because I installed opencv using brew) in Xcode > Build Settings > Header Search Paths (with recursive True) everything worked.

like image 163
Rose Perrone Avatar answered Oct 23 '22 18:10

Rose Perrone