0

So I downloaded raylib-4.2.0_win64_mingw-w64.zip and used some C VS Code template and changed somethings on the tasks.json

tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "DEBUG-build",
            "command": "g++",
            "args": [
                "-g",
                "-std=c++17",
                "-m64",
                "-O0",
                "-Wall",
                "${workspaceFolder}/src/*.cpp",
                "-o",
                "${workspaceFolder}/build/game.exe",
                "-I./src",
                "-I./src/include",
                "-IC:/raylib-mingw64/include",                
                "-static-libgcc",
                "-LC:/raylib-mingw64/lib",
                "-lraylib",
                "-lopengl32",
                "-lgdi32",
                "-lwinmm",
                "-static-libgcc"
            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "type": "shell",
            "group": "build",
            "problemMatcher": [],
            "dependsOrder": "sequence",
            "dependsOn": [
                "debug-dir-check",
                "DEBUG-quick-clean"
            ]
        },
        {
            "label": "RELEASE-build",
            "command": "g++",
            "args": [
                "-std=c++17",
                "-m64",
                "-Ofast",
                "${workspaceFolder}/src/*.cpp",
                "${workspaceFolder}/src/my.o",
                "-o",
                "${workspaceFolder}/build/game.exe",
                "-I./src",
                "-I./src/include",
                "-IC:/raylib-mingw64/include",    
                "-LC:/raylib-mingw64/lib",
                "-lraylib",
                "-lopengl32",
                "-lgdi32",
                "-lwinmm",
                "-static-libgcc"
            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "type": "shell",
            "group": "build",
            "problemMatcher": [],
            "dependsOrder": "sequence",
            "dependsOn": [
                "release-dir-check",
                "RELEASE-quick-clean",              
                "MY-RC-build"        
            ]
        },
        {
            "label": "DEBUG-quick-clean",
            "command": "del ${workspaceFolder}/build/*.exe ; del ${workspaceFolder}/src/*.o",
            "type": "shell",
            "group": "build"
        },
        {
            "label": "DEBUG-clean-dist-copy",
            "command": "robocopy ${workspaceFolder}/dist ${workspaceFolder}/build *.* /MIR /XF .gitignore ; exit 0",
            "type": "shell",
            "group": "build"
        },
        {
            "label": "RELEASE-quick-clean",
            "command": "del ${workspaceFolder}/build/*.exe ; del ${workspaceFolder}/src/*.o",
            "type": "shell",
            "group": "build"
        },
        {
            "label": "RELEASE-clean-dist-copy",
            "command": "robocopy ${workspaceFolder}/dist ${workspaceFolder}/build *.* /MIR /XF .gitignore ; exit 0",
            "type": "shell",
            "group": "build"
        },
        {
            "label": "MY-RC-build",
            "command": "windres ${workspaceFolder}/src/my.rc ${workspaceFolder}/src/my.o",
            "type": "shell",
            "group": "build"
        },
        {
            "label": "debug-dir-check",
            "command": "cmd",
            "args": ["/C", "if not exist ${workspaceFolder}\\build mkdir ${workspaceFolder}\\build"],
            "group": "build"
        },
        {
            "label": "release-dir-check",
            "command": "cmd",
            "args": ["/C", "if not exist ${workspaceFolder}\\build mkdir ${workspaceFolder}\\build"],
            "group": "build"
        },
    ]
}

I tried removing "-static-libgcc" and changing the "-std=" version and other stuff.

I basically expeted it to run and create a window not error this:

C:/raylib-mingw64/lib/libraylib.a(rglfw.o):rglfw.c:(.text+0x2b1e): undefined reference to `__imp__wassert'
C:/raylib-mingw64/lib/libraylib.a(rglfw.o):rglfw.c:(.text+0x2ca7): undefined reference to `__imp__wassert'
C:/raylib-mingw64/lib/libraylib.a(rglfw.o):rglfw.c:(.text+0x2ceb): undefined reference to `__imp__wassert'
C:/raylib-mingw64/lib/libraylib.a(rglfw.o):rglfw.c:(.text+0x2d73): undefined reference to `__imp__wassert'
C:/raylib-mingw64/lib/libraylib.a(rglfw.o):rglfw.c:(.text+0x2dad): undefined reference to `__imp__wassert'
C:/raylib-mingw64/lib/libraylib.a(rglfw.o):rglfw.c:(.text+0x364f): more undefined references to `__imp__wassert' follow
collect2.exe: error: ld returned 1 exit status

+Node: It doesn't happen when I don't use raylib functions.

Command17
  • 11
  • 1
  • raylib-4.2.0_win64_mingw-w64.zip does not match your compiler toolset or build settings. – 273K Feb 12 '23 at 17:48
  • 2
    Consider installing prebuilt raylib from [MSYS2](https://stackoverflow.com/q/30069830/2752075) (along with their version of MinGW). – HolyBlackCat Feb 12 '23 at 17:52

0 Answers0