使用 homebrew 中的 opencv ,编译报错头文件找不到 #2836
Answered
by
waruqi
zchrissirhcz
asked this question in
Q&A
-
在 Apple M1 环境下, 希望 xmake 使用 homebrew 中安装好的 opencv 这一依赖库,遇到的问题是 xmake 命令报错, opencv 的头文件找不到。 test.cpp: #include <opencv2/opencv.hpp>
int main()
{
cv::Mat mat(256, 256, CV_8UC3);
return 0;
} xmake.lua: add_requires("brew::opencv")
target("test")
set_kind("binary")
add_files("test.cpp")
add_packages("brew::opencv") 报错:
完整的复现工程: https://github.com/zchrissirhcz/min-repros/tree/master/test_xmake_opencv |
Beta Was this translation helpful? Give feedback.
Answered by
waruqi
Sep 17, 2022
Replies: 1 comment 1 reply
-
这依赖 pkg-config --cflags opencv 提供的 include 路径,建议使用 xmake-repo 仓库的包,更好的提供 include |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
zchrissirhcz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
这依赖 pkg-config --cflags opencv 提供的 include 路径,建议使用 xmake-repo 仓库的包,更好的提供 include
add_requires("opencv")