Jump to content
  • Advertisement
Sign in to follow this  
os3330

Unresolved external symbol in C++/SDL.

This topic is 3883 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

It's mentioning two files, player.obj and sprite.obj, both classes that "implement" my Locatable class.
player.obj : error LNK2001: unresolved external symbol "public: virtual struct SDL_Rect * __thiscall Locatable::get_offset(void)" (?get_offset@Locatable@@UAEPAUSDL_Rect@@XZ)
sprite.obj : error LNK2001: unresolved external symbol "public: virtual struct SDL_Rect * __thiscall Locatable::get_offset(void)" (?get_offset@Locatable@@UAEPAUSDL_Rect@@XZ)
Here's the Locatable code:
#ifndef LOCATABLE_H
#define LOCATABLE_H

#include "SDL.h"

class Locatable
{
	public:
                // Here, when I put this abstract function in, it creates the                     
                // error in the other classes.
		virtual SDL_Rect* get_offset();
		
		virtual bool check_collision( Locatable*, Locatable* ) =0;
		virtual void draw() =0;
};

#endif // LOCATABLE_H
When I remove that get_offset() function, it runs normally. Is there any link I'm missing?

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!