如何在mac设置C++路径

发布于 2022-09-02 08:49:21 字数 980 浏览 16 评论 0

  CXX(target) Release/obj.target/addon/main.o
../main.cpp:6:10: fatal error: 'opencv2/opencv.hpp' file not found
#include <opencv2/opencv.hpp>
         ^
1 error generated.
make: *** [Release/obj.target/addon/main.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "build"
gyp ERR! cwd /Users/CoderQ/beautiful/bookshelf/gyp/gyp
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok

我node-gyp configure成功,再执行node-gyp rebuild时 出现这个问题 但是/usr/local/include是有这个文件的,我觉得应该是哪个path没设置正确,但我就是不知道到底要设置什么path

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

与往事干杯 2022-09-09 08:49:21

一般是搜索/usr/include的,要不你检查下你的/usr/include是否存在,不存在的话把/usr/local/include软链成/usr/include试试。

花想c 2022-09-09 08:49:21

是你安装opencv的时候没有在编译完导入路径吧。

冷血 2022-09-09 08:49:21
'include_dirs': [
          '/usr/local/include',
        ],

"targets".'link_settings'.'include_dirs' = '/usr/local/include'
找到方法了 building.gyp中增加这个定义 不过又来了个 'cstdint' file not found

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文