Game Development Community

Torque Demo error LNK2001: unresolved external symbol

by Dustin Williams · in Torque Game Engine · 01/03/2005 (6:25 pm) · 8 replies

I've been implementing Thomas Lund's Advanced Camera resource. I believe I integrated all of the new code correctly and that I added the new files to the project, however I still get these errors.

Quote:
Torque Demo error LNK2019: unresolved external symbol "public: class ShapeBase * __thiscall GameConnection::getCameraObject(void)" (?getCameraObject@GameConnection@@QAEPAVShapeBase@@XZ) referenced in function "public: bool __thiscall GameConnection::getControlCameraTransform(float,class MatrixF *)" (?getControlCameraTransform@GameConnection@@QAE_NMPAVMatrixF@@@Z)

Torque Demo error LNK2001: unresolved external symbol "public: class ShapeBase * __thiscall GameConnection::getCameraObject(void)" (?getCameraObject@GameConnection@@QAEPAVShapeBase@@XZ)

Torque Demo fatal error LNK1120: 1 unresolved externals

What did I do wrong? How do I fix this so I can compile in the resource?

#1
01/03/2005 (6:30 pm)
Off the top of my head I would suggest doing a "make clean" and recompiling the entire project again.

Some (but not all, by any means) link errors point to things that have been changed in your code, but weren't properly caught by the compiler/linker's dependency checking. Torque has a pretty good makefile for catching this type of thing, but they are never perfect.

You would need to do the following:

make clean
make
go get some coffee--depending on your system, full makes take a while.
#2
01/04/2005 (11:16 am)
I rebuilt the whole SDK and I'm still getting the same errors. What else would you recommend?
#3
01/04/2005 (11:40 am)
Did you add the definition and body for GameConnection::getCameraObject(void)?
#4
01/04/2005 (12:15 pm)
Hmm...
I bet that's the problem. I only have the console method for getCameraObject in gameConnection.cc. If I'm really missing the function, where is the body, and where do I put it? Thanks. I'll look into it further when I get home.
#5
01/04/2005 (7:45 pm)
The first thing I checked for was the getCameraObject function, but I couldn't find, and I still can't find it. There is a console method called getCameraObject, but regular function (atleast in there isn't in gameConnection.cc). There were no instructions included with the advanced camera resource concerning this function. Now what? Any ideas?
#6
01/04/2005 (8:10 pm)
A quick search in my files has getCameraObject() located in gameConnection.cc.

I have the advanced Camera resource implemented (heh..I wrote part of it), as well as several other mods, add-ons, and kits, but a search of stock TGE 1.3 also has the function in gameConnection.cc:

ShapeBase* GameConnection::getCameraObject()
{
   // If there is no camera object, or if we're first person, return
   // the control object.
   if( !mControlObject.isNull() && (mCameraObject.isNull() || mFirstPerson))
      return mControlObject;
   return  mCameraObject;
}
#7
01/04/2005 (8:54 pm)
I feel stupid now... Looks like I accidently deleted that function when I was implementing the Advanced Camera code. I guess I'll cross-reference with my backup files next time! Thanks a lot!

-Dustin Williams
#8
01/04/2005 (8:59 pm)
Heh..I learned a while back that it's worthwhile to have a "virgin" installation of the stock TGE 1.3 on my hard drive as well as my project files (in my case, working copies of our repositories).

Not only does it help for things like this, but it's a great way to search through files for specific functions and see how they are used, or how they "used to be", since 1.3 is pretty clean when it comes to execution and bugs.

Don't feel stupid though...the only reason I keep this "virgin" copy around is because we've all done exactly what you did some time or another :)