首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在VS Code中交叉编译用于Windows和MinGW的SDL程序

在VS Code中交叉编译用于Windows和MinGW的SDL程序
EN

Stack Overflow用户
提问于 2020-02-26 12:12:37
回答 1查看 225关注 0票数 0

我想用VSCodium创建一个集成开发环境,在那里我可以交叉编译Linux和Linux上的Windows程序。我想使用SDL2,但我在使用MinGW和g++时遇到了问题。也许有人知道正确的g++命令。目前我得到的是这样的:

代码语言:javascript
复制
{
    // 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"
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-10-01 07:09:10

如果您遇到与我相同的问题,那么使用一些外部软件进行编译(编写same脚本或使用make)会更容易一些。因为如果你有一个更大的项目,你很容易遇到问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60406673

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档