SDL2: LNK1561: entry point must be defined

后端 未结 6 1893
天命终不由人
天命终不由人 2020-12-09 04:18

I want to compile this code:

#include 

int main(int argc, char* argv[]) {
    return 0;
}

But it can\'t be linked: Erro

6条回答
  •  北海茫月
    2020-12-09 04:48

    I have found that setting /SUBSYSTEM:CONSOLE is only half of the solution. The second half is to add SDL_MAIN_HANDLED to your additional defines. The clue I used to resolve this can be found in SDL_main.h. Setting SDL_MAIN_HANDLED tell the SDL header files that you've already provided a main function and do not wish for it to redefine its own entry point.

提交回复
热议问题