$ g++ --version g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ cmake --version cmake version 3.16.3
CMake suite maintained and supported by Kitware (kitware.com/cmake). $ make --version GNU Make 4.2.1 为 x86_64-pc-linux-gnu 编译 Copyright (C) 1988-2016 Free Software Foundation, Inc. 许可证:GPLv3+:GNU 通用公共许可证第 3 版或更新版本<http://gnu.org/licenses/gpl.html>。 本软件是自由软件:您可以自由修改和重新发布它。 在法律允许的范围内没有其他保证。
$ ls CMakeLists.txt DisplayImage.cpp susu.jpg $ mkdir build $ cd build/ $ cmake .. -- The C compiler identification is GNU 9.4.0 -- The CXX compiler identification is GNU 9.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found OpenCV: /usr (found version "4.2.0") -- Configuring done -- Generating done -- Build files have been written to: /home/lyfubuntu/my_computer_language/temp/temp/build $ make Scanning dependencies of target DisplayImage [ 50%] Building CXX object CMakeFiles/DisplayImage.dir/DisplayImage.cpp.o [100%] Linking CXX executable DisplayImage [100%] Built target DisplayImage $ ls CMakeCache.txt CMakeFiles cmake_install.cmake DisplayImage Makefile $ ./DisplayImage ../susu.jpg $