Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

Winmain@16 error

Does anyone know how to fix the "undefined reference to "Winmain16" error? (There is supposed to be an at symbol between main and 16 but treehouse does something weird if I put that symbol in the text). I am trying to get SDL to work with VS Code and I get that error. It seems that this is a common error, looking it up on the internet. Yet through all of those webpages I couldn't find one valid solution. Here is my json file I'm trying to build with to make this work:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "echo",
            "type": "shell",
            "command": "g++",
            "args": [
                "-g",
                "-o",
                "-c",
                "C:/MinGW/bin/main2.cpp",
                "C:/MinGW/bin/main.cpp",
                "C:/MinGW/bin/SDL2.lib",
                "-lmingw32",
                "-mwindows"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ]
        },
        {
            "label": "echo",
            "type": "shell",
            "command": "g++",
            "args": [
                "-o",
                "C:\\MinGW\\bin\\main.cpp",
                "C:\\cpp\\pointer.o"
            ],
            "problemMatcher": [
                "$gcc"
            ]
        }
    ]
}