源码编译opencv 找不到cmake3
-D WITH_CUBLAS=ON ..
-- The CXX compiler identification is GNU 5.5.0
-- The C compiler identification is GNU 5.5.0
-- Check for working CXX compiler: /usr/local/gcc/bin/g++
-- Check for working CXX compiler: /usr/local/gcc/bin/g++ -- broken
CMake Error at /usr/share/cmake3/Modules/CMakeTestCXXCompiler.cmake:45 (message):
The C++ compiler
"/usr/local/gcc/bin/g++"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/menglingjun/menglingjun/software/opencv-master/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTC_39633/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_39633.dir/build.make CMakeFiles/cmTC_39633.dir/build
gmake[1]: Entering directory `/data/menglingjun/software/opencv-master/build/CMakeFiles/CMakeTmp'
/bin/sh: /usr/bin/cmake3: No such file or directory
gmake[1]: *** [CMakeFiles/cmTC_39633.dir/testCXXCompiler.cxx.o] Error 127
gmake[1]: Leaving directory `/data/menglingjun/software/opencv-master/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_39633/fast] Error 2
CMake will not be able to correctly generate this project.
关注这里/bin/sh: /usr/bin/cmake3: No such file or directory
我查看了一下/usr/bin/下有cmake,查一下cmake版本(cmake --version)发现cmake是3版本,我觉得这个cmake就是3,所以创建一个软链(副本)
ln -s cmake cmake3
我这里就ok了,如果你有别的问题,百度其他地方把。