我刚安装了SDL,它给了我一个警告,让它不会编译。
这是构建日志:
-------------- Build: Debug in Graphics (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -LC:\Users\73638G75MA\Documents\SDL2-2.0.3\lib\x86 -o bin\Debug\Graphics.exe obj\Debug\main.o -lmingw32 -lSDL2main -lSDL2
C:\Users\73638G75MA\Documents\SDL2-2.0.3\lib\x86/SDL2main.lib(./Release/SDL_windows_main.obj):(.text[_main]+0x0): multiple definition of `main'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libmingw32.a(main.o):(.text.startup+0x0): first defined here
Warning: corrupt .drectve at end of def file
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
0 error(s), 1 warning(s) (0 minute(s), 0 second(s))
和代码:
#include <iostream>
#include <SDL.h>
using namespace std;
int main(int argc, char *argv[]){
SDL_Init(SDL_INIT_EVERYTHING);
SDL_Quit();
return 0;
}
答案 0 :(得分:1)
我链接到错误的SDL \ include和SDL \ bin,链接到x64而不是x86一个