天天看點

ubuntu18.04安裝opencv時遇到的問題

參考連結:https://blog.csdn.net/new_delete_/article/details/84797041

在安裝opencv,遇到的問題。

執行如下代碼

$ cmake -D CMAKE_BUILD_TYPE=Release -D OPENCV_GENERATE_PKGCONFIG=YES -D CMAKE_INSTALL_PREFIX=/usr/local/opencv4 ..

           

報錯:CMake Error: The source directory "/xxx/xxx/下載下傳/opencv-4.0.0/build/CMAKE_INSTALL_PREFIX=/xxx/xxx/opencv4" does not exist.

解決:去掉-D後面的空格

接着報錯:CMake Error: The source directory "/xxx/xxx/opencv-4.0.0/build" does not appear to contain CMakeLists.txt.

原因:我在複制上面執行代碼去掉-D後面空格的時候把最後的兩個..也給去掉了,注意千萬不能去掉這兩個..