Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.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
C++ OpenCV-';cstdint';找不到文件_C++_Xcode_Macos_Opencv - Fatal编程技术网

C++ OpenCV-';cstdint';找不到文件

C++ OpenCV-';cstdint';找不到文件,c++,xcode,macos,opencv,C++,Xcode,Macos,Opencv,我正在使用Mac 10.10和OpenCV 3.0,当我编译我的项目时,我遇到了以下错误: ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) 之后,我将C++标准库改为LIbSTDC++ +,出现了另一个错误: /未找到usr/local/include/opencv2/hal/defs.h

我正在使用Mac 10.10和OpenCV 3.0,当我编译我的项目时,我遇到了以下错误:

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

之后,我将C++标准库改为LIbSTDC++ +,出现了另一个错误:

/未找到usr/local/include/opencv2/hal/defs.h:271:14:'cstdint'文件


希望有人能帮助我

基于上面的答案,有两种方法可以解决这个问题,因为您使用的是macOs,默认编译器是Clang。您可以使用:

#include <tr1/cstdint>
#包括

#包括

而不是CSTNDT,这是LBC+++的一部分。

< P>我尝试将一个为C++编写的头(h)导入到一些目标C代码(m)中时,点击了这个。

解决方案是创建一个中间的目标C++文件(.mm)和一个导入C++头的出口,然后导出C兼容的包装函数。 头文件中有类似的内容,可以很好地处理Objective-C(.m)代码


(感谢您帮助我解决了所有这些问题。)

如果您解决了问题,请告诉我。我也有一个。真的很抱歉,我不记得怎么修了。我想这可能是由xcode编译器引起的。我的Mac电脑已经重新安装,所以我遵循了本教程,它适合我
#include <stdint.h>
#if defined(__cplusplus)
extern "C" {
#endif

const char *MyNewFunction(void); // or whatever

#if defined(__cplusplus)
}
#endif