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

Albert Ridolfi arfx4 at yahoo.co.uk
Sat Jul 15 17:43:12 PDT 2006


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:
=========================================
#include "stdafx.h"
#include "SDL.h"
#include "SDL_thread.h"
#include "SDL_mixer.h"



int _tmain(int argc, _TCHAR* argv[])
{
	Mix_Chunk *chunk = Mix_LoadWAV("E:\\open sonic\\ogg\\st3.ogg");
	if(chunk!=NULL) fprintf(stderr,"Loaded myfile.wav\n");
	else            fprintf(stderr,"Could not load myfile.wav\n");


	return 0;
}

======================================

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	

After that, I downloaded the SDL Mixer source and built all the libraries,
then copied all of them to the SDL lib folder, and the includes to the SDL
includes folder. Now, in addition to the 2 errors the compiler gave me, it
also gives me this error:
Error	3	fatal error LNK1120: 2 unresolved externals	C:\Documents
and Settings\Albert\My Documents\Visual Studio
2005\Projects\sdltest2\Debug\sdltest2.exe	1	


Does someone have any clue on this? I hope I won't have to switch off to
DirectX :-P

Thanks,

Albert






More information about the SDL mailing list