Makefile
-
Two operations of CMake under windows (using VScode)
-
The first way is to directly use the Cmake plugin that comes with VSCode
-
Install CMake directly in VSCode
-
# 在CMakeLists中配置如下信息: cmake_minimum_required(VERSION 3.10) set(CMAKE_C_COMPILER "gcc") set(CMAKE_CXX_COMPILER "g++") project(main) add_executable(main main.cpp fact.cpp printhello.cpp)
-
Then
CTRL+SHIFT+P
quickly build CMake, click CMake configuration, and the build folder will appear -
cd build mingw32-make main.exe
-
-
the second way
-
After installing CMake Windows, configure CMakeLists
-
mkdir compile_main cd compile_main cmake .. #cmake 上一层目录中的CMakeLists cmake -- build . cd compile_main/debug main.exe
-