我使用的是Mac10.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‘文件
希望有人能帮我
发布于 2016-07-10 22:57:51
根据这篇question中的最高答案,有两种方法可以解决这个问题,因为你使用的是macOs,而你的默认编译器是Clang。您可以使用:
#include <tr1/cstdint>或
#include <stdint.h>这是libc++的一部分,而不是cstdint。
发布于 2021-06-10 03:52:51
在尝试将为C++编写的头文件(.h)导入到一些Objective C代码(.m)中时,我遇到了这个问题。
我的解决方案是创建一个中间目标C++文件(.mm)和头文件,其中导入了C++头文件,然后导出了与c兼容的包装器函数。
头文件中有这样的内容,以便与Objective-C (.m)代码很好地配合使用
#if defined(__cplusplus)
extern "C" {
#endif
const char *MyNewFunction(void); // or whatever
#if defined(__cplusplus)
}
#endif(感谢Dave Hylands帮我解决了所有这些问题。)
https://stackoverflow.com/questions/32552249
复制相似问题