Linker error

Get answers to all your basic programming questions. No Ogre questions, please!
PandaProtector
Gnoblar
Posts: 1
Joined: Sat Feb 11, 2012 8:39 pm

Linker error

Post by PandaProtector »

Hi, I'm using VC++ 2008 Express and I'm having a linker problem. I create an OGRE basic application and it run fine. Now, i want to use other file i have to create a variable infland::CLandscape m_Landscape;. Basicly, i just #include "InfiniteLandscapes/il_landscape.h" (the file that contain the class declaration and etc..). It compile well and it can find the include file without any problem. the problem is, at linking stage, i received the following error:
1>Wink.obj : error LNK2019: unresolved external symbol "public: __thiscall infland::CLandscape::~CLandscape(void)" (??1CLandscape@infland@@QAE@XZ) referenced in function __unwindfunclet$??0Wink@@QAE@XZ$0
1>Wink.obj : error LNK2019: unresolved external symbol "public: __thiscall infland::CLandscape::CLandscape(void)" (??0CLandscape@infland@@QAE@XZ) referenced in function "public: __thiscall Wink::Wink(void)" (??0Wink@@QAE@XZ)

I know it have to do something with the constructor/destructor, but they are fine. Anyone have encounter an error like this before? Is there a setting i need to change in the Project properties? Thank you :)

PS: sorry for bad English, I'm a francophone.
iblues1976
Gnome
Posts: 379
Joined: Fri Sep 16, 2011 4:54 pm
x 10

Re: Linker error

Post by iblues1976 »

The problem is that the linker is not able to find the library.

You have to add 2 things...
Additional Library directory and add the library name in the input...
No difference than the instructions on how to add the libraries for Ogre...
Now, depending on this external library you are referring, it is possible that it may be called

mylibrary.lib or mylibrary_d.lib (for debug...) you will have to check

EDIT:
(You have to modify project settings.)
====
I hope this helps.
iblues1976
Gnome
Posts: 379
Joined: Fri Sep 16, 2011 4:54 pm
x 10

Re: Linker error

Post by iblues1976 »

I'm on my win computer today. So, just to add to my previous post.

Add the directory of your library to Additional Include Directories, under linker from the project properties... for example, $(OGRE_HOME)\lib\$(Configuration)

also, in the input tab of the linker, go to the input property and add the libraries needed, for example

Code: Select all

OgreTerrain_d.lib
OgreMain_d.lib
OIS_d.lib
CEGUIBase_d.lib
CEGUIOgreRenderer_d.lib