Windows下使用mingw的g++编译的程序怎么在别人电脑运行
需要静态链接标准库,在链接过程中使用 -static
makefile的头部可这么写
CXX :=g++
CXXFLAGS := -std=c++11 -O3 -fopenmp -Wfatal-errors
LINKFLAGS :=
#If the operating system is windows
ifeq ($(OS),Windows_NT)
LINKFLAGS += -static
endif
...
原创
2020-08-15 10:21:41 ·
937 阅读 ·
0 评论