我正在尝试使用 task.json 来构建我的项目而不是 Makefile,但是当我将 Makefile 参数放入 task.json 并运行该任务时,我收到错误。
我希望将我的 Makefile 转换为 task.json,但是当我这样做时,这不起作用。
all:
cls
g++ -D_GNU_SOURCE -I src/include -L src/lib -o TKM main.cpp ressources.o src/include/manmade/Class/* src/include/manmade/Components/* src/include/manmade/Part/* src/include/manmade/Declaration/* -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_ttf
./TKM
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "G++ tasks",
"command": "g++",
"args": [
"-std=c++23",
"-D_GNU_SOURCE",
"-I src/include",
"-L src/lib",
"-o TKM2",
"main.cpp",
"ressources.o",
"src/include/manmade/Class/*",
"src/include/manmade/Components/*",
"src/include/manmade/Part/* ",
"src/include/manmade/Declaration/*",
"-lmingw32",
"-lSDL2main",
"-lSDL2",
"-lSDL2_image",
"-lSDL2_ttf"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": "build",
"detail": "compiler: C:\\mingw64\\bin\\g++.exe"
}
]
}
操作系统:Windows