Jump to content
  • Advertisement
Sign in to follow this  

Linking error w/ SDL_rwops functions

This topic is 4886 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
int _tmain(int argc, _TCHAR* argv[])
	// Link error!
	SDL_RWops *rw = SDL_RWFromFile("data/mesh.3ds", "rb");

	// This works.

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

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!