我最近安装了 OpenCV(使用 cmake),当我尝试从 sample/c 运行例如 build_all.sh 时,我收到以下错误:
compiling fback_c.c
gcc: error: rt: No such file or directory
gcc: error: pthread: No such file or directory
gcc: error: m: No such file or directory
gcc: error: dl: No such file or directory
......................................
compiling find_obj_calonder.cpp
g++: error: rt: No such file or directory
g++: error: pthread: No such file or directory
g++: error: m: No such file or directory
g++: error: dl: No such file or directory
注意:它们还有更多,但每个文件都相同。
但是当我在来自 sample/cpp 的样本上使用它时,程序实际上会编译:
g++ test.cpp -o test -I/usr/local/include/opencv -I/usr/local/include -L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann
此外,当我尝试编译 .py 文件时,我收到以下错误
ImportError: No module named cv2
我正在使用 x64 Fedora 19。
我想知道为什么当我使用该命令时程序编译但当我使用默认方法时它不起作用。另外我应该怎么做才能编译 .py ?