Кросс-компиляция SDL-программ для Windows с MinGW на Linux в VS Code? - PullRequest
0 голосов
/ 26 февраля 2020

Я хотел бы создать IDE с VSCodium, где я могу кросс-компилировать программы для Linux и Windows на Linux. Я хотел бы использовать SDL2 с ним, но у меня есть проблемы, чтобы сделать это с MinGW и g ++ для Windows. Может быть, кто-то знает правильную команду g ++ для этого. В настоящее время я получил это:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build-C++-SLD2-Linux",
            "type": "shell",
            "command": "g++",
            "args": [
                "-g",
                "*.cpp",
                "-I/usr/include/SDL2",
                "-lSDL2",
                "-o",
                "App.exe"
            ],
            "group": "build"
        },
        {
            "label": "build-C++-SLD2-Windows",
            "type": "shell",
            "command": "g++",
            "args": [
                "*.cpp",
                "-I/usr/include/SDL2",
                "-lSDL2",
                "-lSDL2main",
                "-L/usr/x86_64-w64-mingw32/bin",
                "-o",
                "AppWin64.exe"

            "group": "build"
            ],
        },
        {
            "label": "build-C++-SLD2-Windows-alt",
            "type": "shell",
            "command": "x86_64-w64-mingw32-g++",
            "args": [
                "-g",
                "*.cpp",
                "-I/home/username/Dokumente/SDL2",
                "-L/home/username/Dokumente/lib",
                "-L/usr/x86_64-w64-mingw32/bin",
                "-lSDL2",
                "-o",
                "AppWin.exe"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ],
    "group": {
        "kind": "build",
        "isDefault": true
    },
    "problemMatcher":"$gcc"
}
...