Advertisement

Linking error w/ SDL_rwops functions

Started by January 06, 2005 04:12 PM
1 comment, last by Doggan 20 years, 1 month ago
Using the SDL_RWFromFile function, (or any of the functions defined as extern in SDL_rwops.h), I am getting a linking error: main.obj : error LNK2019: unresolved external symbol _SDL_RWFromFile referenced in function _main Here's a simple example:

#pragma comment ( "SDL.lib", lib )
#pragma comment ( "SDLmain.lib", lib )

#include "windows.h"
#include <iostream>
#include <tchar.h>

#include "SDL.h"
#include "SDL_types.h"
#include "SDL_rwops.h"

#ifdef WIN32
#undef main
#endif
int _tmain(int argc, _TCHAR* argv[])
{
	// Link error!
	SDL_RWops *rw = SDL_RWFromFile("data/mesh.3ds", "rb");

	// This works.
	SDL_RWclose(rw);

	return 0;
}

I have access to all of the macros and data structurs in SDL_rwops, but not the functions. Thanks :(
Do you have to link for RW_OPS seperately? All that other stuff you talked about would be in the headers.
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
Advertisement
Problem solved. I took a break after staring at the code forever. I had my #pragma parameters reversed, and I was compiling in single-threaded mode :( Thank you.

This topic is closed to new replies.

Advertisement