在CMakeLists.txt中加入:
set(CMAKE_EXE_LINKER_FLAGS -static)
完美解決,是沒有雙引號的
cmake_minimum_required(VERSION 3.27)
project(untitled1)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_EXE_LINKER_FLAGS -static)
add_executable(untitled1 main.cpp)
在CMakeLists.txt中加入:
set(CMAKE_EXE_LINKER_FLAGS -static)
完美解決,是沒有雙引號的
cmake_minimum_required(VERSION 3.27)
project(untitled1)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_EXE_LINKER_FLAGS -static)
add_executable(untitled1 main.cpp)