[SDL] compile error under vc++ - unresolved external symbol
Albert Ridolfi
arfx4 at yahoo.co.uk
Sat Jul 15 20:46:24 PDT 2006
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
-----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 Peter
Mulholland
Sent: 16 July 2006 03:02
To: A list for developers using the SDL library. (includes SDL-announce)
Subject: Re: [SDL] compile error under vc++ - unresolved external symbol
Albert Ridolfi wrote:
> Hello,
>
> I installed SDL 1.2 into my VC++ 2005 (Windows) and it worked fine, and
> later I tried to install SDL Mixer. First I used the precompiled lib files
> available for download on the SDL website, and I tried to compile the
> following code:
<snip>
VS2005 might have changed the symbol format. You are best building
SDL/SDL_mixer yourself.
> int _tmain(int argc, _TCHAR* argv[])
Don't do this. Your code will not be handled correctly by the SDL entry
point code.
> The compiler gave me two errors:
> Error 1 error LNK2019: unresolved external symbol _Mix_LoadWAV_RW
> referenced in function _wmain sdltest2.obj
> Error 2 error LNK2019: unresolved external symbol _SDL_RWFromFile
> referenced in function _wmain sdltest2.obj
Are you adding the libs to your linker settings?
Some headers use #pragma (lib, "blah.lib") to make this unneccesary. SDL
doesn't because that isn't portable.
Pete.
_______________________________________________
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
More information about the SDL
mailing list