• Advertisement
Sign in to follow this  

Linking error w/ SDL_rwops functions

This topic is 4794 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :(

Share this post


Link to post
Share on other sites
Advertisement
Do you have to link for RW_OPS seperately? All that other stuff you talked about would be in the headers.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement