我准备了一个 setup.py 文件,它需要 opencv 库 contrib、core 和 highgui。但是当我构建 setup.py 时,我收到一条错误消息
/usr/bin/ld:cannot find -lcontrib
/usr/bin/ld:cannot find -lcore
/usr/bin/ld:cannot find -lhighgui
我在 ld.so.conf 文件中添加了一个条目“include/usr/local/lib”,并从终端运行命令 ldconfig。仍然遇到同样的错误。请指教。
最佳答案
链接器标志应为 -lopencv_contrib
, -lopencv_core
和-lopencv_highgui
对于从源代码安装的标准 OpenCV2.4+ 或使用预构建的二进制文件时。还要确保这些库确实存在于 /usr/local/lib
中。你可以运行ls /usr/local/lib | grep opencv
看看它们是否存在。
关于python - ubuntu 构建时未找到库错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31637518/