问题描述
我知道有人问过类似的问题,但没有一个答案对我有帮助...
I know that similar questions had been asked but none of the answers helped me...
我编写了一个简单的SDL程序:
I wrote a simple SDL program:
#include "SDL.h"
int main( int argc, char* args[] )
{
//Start SDL
SDL_Init( SDL_INIT_EVERYTHING );
//Quit SDL
SDL_Quit();
return 0;
}
使用代码:块.我遵循了本教程 http://lazyfoo.net/SDL_tutorials/lesson01/windows/codeblocks /index.php 但我仍然无法编译.这是构建日志:
using Code:Blocks. I followed this tutorial http://lazyfoo.net/SDL_tutorials/lesson01/windows/codeblocks/index.phpbut I still cannot compile. Here is the build log:
mingw32-g++.exe -LC:\SDL\SDL2\lib\x86 -o bin\Debug\test.exe obj\Debug\test.o -lmingw32 -lSDL2main -lSDL2 -mwindows
C:\SDL\SDL2\lib\x86/SDL2main.lib(./Release/SDL_windows_main.obj):(.text[_main]+0x0): multiple definition of `main'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../libmingw32.a(main.o):main.c:(.text.startup+0x0): first defined here
Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
collect2.exe: error: ld returned 1 exit status
有什么主意吗?
推荐答案
为Code :: Blocks设置SDL2.0的正确链接是 http://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/codeblocks/index.php .这将有助于进行正确的设置.
The correct link to follow for setting up SDL2.0 for Code::Blocks is http://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/codeblocks/index.php.This will help to make the correct setup.
32位库位于i686-w64-mingw32文件夹中.
The 32bit libraries are in i686-w64-mingw32 folder.
这篇关于SDL 2.0:链接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!