[SDL] compile error under vc++ - unresolved external symbol

Albert Ridolfi arfx4 at yahoo.co.uk
Sun Jul 16 13:37:48 PDT 2006


I found a tutorial that told me to add to the code:
#ifdef WIN32
#pragma comment(lib, "SDL.lib")
#pragma comment(lib, "SDLmain.lib")
#endif

Now it's working. Thanks for the help

-----Original Message-----
From: sdl-bounces+arfx4=yahoo.co.uk at libsdl.org
[mailto:sdl-bounces+arfx4=yahoo.co.uk at libsdl.org] On Behalf Of Salvatore Di
Fazio
Sent: 16 July 2006 07:37
To: SDL
Subject: Re: [SDL] compile error under vc++ - unresolved external symbol

Hello Albert,
the better way to work in vs2005 with the SDL is:

1 - Make a empty project
2 - copy all the precompilated libraries under
    \Programmi\Microsoft Visual Studio 8\VC\lib
3 - copy all the headers files under
    \Programmi\Microsoft Visual Studio 8\VC\include\SDL
4 - copy all the dll under:
    C:\Windows\System32
5 - Set the project with the libraries that you will use:
    Right-click on the project -> Options -> Linker -> Input:
    SDLmain.lib SDL.lib etc.lib

Where you must insert SDLmain.lib SDL.lib, and the etc.lib are, for example,
SDL_image.lib, SDL_mixer.lib.



Albert Ridolfi ha scritto:
> Hello Peter,
> 
> I was using the pre-compiled libraries, but now I have built them all 
> by myself, and this didn't fix the problem.
> 
> I modified just the main function and the signature, and removed 
> #include "stdafx.h", now it is just int main()
> 
> Yes, the libraries were added to the linker settings. 
> 
> The compiler output:
> main.obj : error LNK2019: unresolved external symbol _Mix_LoadWAV_RW 
> referenced in function "int __cdecl SDL_main(void)" (?SDL_main@@YAHXZ) 
> main.obj : error LNK2019: unresolved external symbol _SDL_RWFromFile 
> referenced in function "int __cdecl SDL_main(void)" (?SDL_main@@YAHXZ)
> MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol 
> _main referenced in function ___tmainCRTStartup
> 
> Thanks for the help
> Albert


_______________________________________________
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl





More information about the SDL mailing list