Jump to content
  • Advertisement
Sign in to follow this  
Mybowlcut

Release configuration unresolved external symbol errors

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

Hey. I am developing a library which I test with this .cpp file:
#include "vld.h"

#include <vector>
#include <algorithm>
#include <functional>
#include <string>

#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_ttf.h"
#include "SDL/SDL_mixer.h"

#include "Directory.h"
#include "Renderer.h"
#include "IO.h"
#include "Level.h"
#include "Level_Manager.h"
#include "Party.h"
#include "Player.h"
#include "Player_Controller.h"
#include "Player_View.h"
#include "SDL_Surface_Exception.h"
#include "SDL_Tools.h"

int main(int argc, char* argv[])
{
	SDL_Event event_;
	bool exit = false;

	Surface_Cache surface_cache;
	Renderer renderer(surface_cache, 640, 480, 24, "SDL Testing", "C:/WINDOWS/Fonts/Arial.ttf", 50);
	surface_cache.Load_Surfaces("surfaces_to_load.txt");

	Player_Controller default_controller;
	Player_View default_view;

	Player player1("mitch", "Levels\\mitch.png", Point(0, 0), default_controller, default_view);
	
	Party party(3);
	party.Add_Member(&player1);

	Level_Manager level_manager(Level_Manager::Path_Info(
		"Levels\\", "_level_list.txt", "_tiles.txt", "_portals.txt"), &party);

	while(!exit)
	{
		while(SDL_PollEvent(&event_))
		{
			if(event_.type == SDL_QUIT)
			{
				exit = true;
				break;
			}

			level_manager.Update(&event_);
			level_manager.Draw(renderer);

			renderer.Draw_Screen();
		}
	}

	return 0;
}

The .cpp file is the only file in a project called SDL_Testing... here are the linker command line options for SDL_Testing:
Quote:
/OUT:"C:\Documents and Settings\Bill\My Documents\Visual Studio 2005\Projects\SDL_Testing\Debug\SDL_Testing.exe" /INCREMENTAL /NOLOGO /LIBPATH:"C:\Documents and Settings\Bill\My Documents\Visual Studio 2005\Projects\SDL_Game_Engine\debug" /MANIFEST /MANIFESTFILE:"Debug\SDL_Testing.exe.intermediate.manifest" /NODEFAULTLIB:"(/NODEFAULTLIB:[uuid.lib" /NODEFAULTLIB:"msvcrt.lib])" /DEBUG /PDB:"c:\Documents and Settings\Bill\My Documents\Visual Studio 2005\Projects\SDL_Testing\debug\SDL_Testing.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 /ERRORREPORT:PROMPT SDL.lib SDLmain.lib SDL_image.lib SDL_ttf.lib SDL_mixer.lib msvcrtd.lib SDL_Game_Engine.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
Then I have my library which is a static library with these linker command line options:
Quote:
/OUT:"C:\Documents and Settings\Bill\My Documents\Visual Studio 2005\Projects\SDL_Game_Engine\Debug\SDL_Game_Engine.lib" /NOLOGO
When I build the Release configuration for my SDL_Testing project, I get these errors:
Quote:
Testing.obj : error LNK2001: unresolved external symbol "public: __thiscall Player_View::Player_View(void)" (??0Player_View@@QAE@XZ) Testing.obj : error LNK2001: unresolved external symbol "class std::basic_istream<char,struct std::char_traits<char> > & __cdecl operator>>(class std::basic_istream<char,struct std::char_traits<char> > &,class Level &)" (??5@YAAAV?$basic_istream@DU?$char_traits@D@std@@@std@@AAV01@AAVLevel@@@Z) Testing.obj : error LNK2001: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall Level::Name(void)const " (?Name@Level@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) Testing.obj : error LNK2001: unresolved external symbol _SDL_PollEvent Testing.obj : error LNK2001: unresolved external symbol "public: bool __thiscall Party::Add_Member(class Player *)" (?Add_Member@Party@@QAE_NPAVPlayer@@@Z) Testing.obj : error LNK2001: unresolved external symbol "public: __thiscall Party::Party(unsigned int)" (??0Party@@QAE@I@Z) Testing.obj : error LNK2001: unresolved external symbol "public: __thiscall Point::~Point(void)" (??1Point@@QAE@XZ) Testing.obj : error LNK2001: unresolved external symbol "public: __thiscall Point::Point(short,short)" (??0Point@@QAE@FF@Z) Testing.obj : error LNK2001: unresolved external symbol "public: __thiscall Player::Player(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class Point const &,class Player_Controller &,class Player_View &)" (??0Player@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0ABVPoint@@AAVPlayer_Controller@@AAVPlayer_View@@@Z) Testing.obj : error LNK2001: unresolved external symbol "public: void __thiscall Surface_Cache::Load_Surfaces(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?Load_Surfaces@Surface_Cache@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) Testing.obj : error LNK2001: unresolved external symbol "public: __thiscall Surface_Cache::Surface_Cache(void)" (??0Surface_Cache@@QAE@XZ) Testing.obj : error LNK2001: unresolved external symbol "struct SDL_Color __cdecl SDL_Tools::colour(unsigned char,unsigned char,unsigned char)" (?colour@SDL_Tools@@YA?AUSDL_Color@@EEE@Z) Testing.obj : error LNK2001: unresolved external symbol "public: __thiscall Player_Controller::Player_Controller(void)" (??0Player_Controller@@QAE@XZ) Testing.obj : error LNK2001: unresolved external symbol "public: void __thiscall Renderer::Draw_Screen(void)" (?Draw_Screen@Renderer@@QAEXXZ) Testing.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall Renderer::~Renderer(void)" (??1Renderer@@UAE@XZ) Testing.obj : error LNK2001: unresolved external symbol "public: __thiscall Renderer::Renderer(class Surface_Cache &,unsigned short,unsigned short,unsigned short,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (??0Renderer@@QAE@AAVSurface_Cache@@GGGABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@1H@Z) Testing.obj : error LNK2001: unresolved external symbol "public: __thiscall Level_Manager::Path_Info::Path_Info(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0Path_Info@Level_Manager@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@000@Z) Testing.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Level_Manager::Draw(class Renderer &)" (?Draw@Level_Manager@@UAEXAAVRenderer@@@Z) Testing.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Level_Manager::Update(union SDL_Event const *)" (?Update@Level_Manager@@UAEXPBTSDL_Event@@@Z) Testing.obj : error LNK2001: unresolved external symbol "public: __thiscall Level_Manager::Level_Manager(struct Level_Manager::Path_Info const &,class Party *)" (??0Level_Manager@@QAE@ABUPath_Info@0@PAVParty@@@Z) SDLmain.lib(SDL_win32_main.obj) : error LNK2001: unresolved external symbol _SDL_SetModuleHandle SDLmain.lib(SDL_win32_main.obj) : error LNK2001: unresolved external symbol _SDL_GetError SDLmain.lib(SDL_win32_main.obj) : error LNK2001: unresolved external symbol _SDL_Init SDLmain.lib(SDL_win32_main.obj) : error LNK2001: unresolved external symbol _SDL_strlcpy SDLmain.lib(SDL_win32_main.obj) : error LNK2001: unresolved external symbol _SDL_Quit SDLmain.lib(SDL_win32_main.obj) : error LNK2001: unresolved external symbol _SDL_strlcat
I have no idea why these are showing up... Any help is appreciated. Cheers.

Share this post


Link to post
Share on other sites
Advertisement
When you switch configuration (debug to release), every settings in your project are different, so you probably are reset to default on the release configuration. You should simply add the additional lib files and lib path again for the release too, just like you did in debug.

Share this post


Link to post
Share on other sites
Quote:
Original post by Dunge
When you switch configuration (debug to release), every settings in your project are different, so you probably are reset to default on the release configuration. You should simply add the additional lib files and lib path again for the release too, just like you did in debug.
Yeah I usually get it right but this time my copy-paste missed two libs... haha. :s

Cheers!

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.

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!