Archived

This topic is now archived and is closed to further replies.

Velochy

Unresolved external symbols

Recommended Posts

all the files compile without a hitch but when it starts linking it throws these: Linking... Animation.obj : error LNK2001: unresolved external symbol "public: void __thiscall cQuaternion::ConvertToAxisAngle(void)" (?ConvertToAxisAngle@cQuaternion@@QAEXXZ) Animation.obj : error LNK2001: unresolved external symbol "public: int __thiscall cPart::ApplyCurrentToRotFrom(class cQuaternion *,int)" (?ApplyCurrentToRotFrom@cPart@@QAEHPAVcQuaternion@@H@Z) BSPStuff.obj : error LNK2001: unresolved external symbol "public: bool __thiscall cCITriangle::CheckSplit(class cPlane &,class cVertex *)" (?CheckSplit@cCITriangle@@QAE_NAAVcPlane@@PAVcVertex@@@Z) BSPStuff.obj : error LNK2001: unresolved external symbol "public: enum ePlaneLocation __thiscall cPlane::Test(class cPoint3 const &)" (?Test@cPlane@@QAE?AW4ePlaneLocation@@ABVcPoint3@@@Z) BSPStuff.obj : error LNK2001: unresolved external symbol "public: void __thiscall cPlane::Create(class cPoint3 const &,class cPoint3 const &,class cPoint3 const &)" (?Create@cPlane@@QAEXABVcPoint3@@00@Z) Culling.obj : error LNK2001: unresolved external symbol "public: float __thiscall cPlane::Func(class cPoint3 const &)" (?Func@cPlane@@QAEMABVcPoint3@@@Z) Patches.obj : error LNK2001: unresolved external symbol "public: float __thiscall cPlane::Func(class cPoint3 const &)" (?Func@cPlane@@QAEMABVcPoint3@@@Z) Rendering.obj : error LNK2001: unresolved external symbol "public: float __thiscall cPlane::Func(class cPoint3 const &)" (?Func@cPlane@@QAEMABVcPoint3@@@Z) InitGame.obj : error LNK2001: unresolved external symbol "public: void __thiscall GfxLayer::DrawOneFrame(unsigned long)" (?DrawOneFrame@GfxLayer@@QAEXK@Z) InitGame.obj : error LNK2001: unresolved external symbol "public: void __thiscall GfxLayer::SetRenderStates(void)" (?SetRenderStates@GfxLayer@@QAEXXZ) InitGame.obj : error LNK2001: unresolved external symbol "public: bool __thiscall GfxLayer::CreateBuffers(unsigned int)" (?CreateBuffers@GfxLayer@@QAE_NI@Z) Rendering.obj : error LNK2001: unresolved external symbol "public: bool __thiscall cPart::Transform(class cMatrix4,class cMatrix4,class cVertex *,unsigned int,unsigned int *,class cITriangle *,unsigned int,unsigned int *,class stlport::vector > *,class cFrustum *,unsigned int *,unsigned int)" (?Transform@cPart@@QAE_NVcMatrix4@@0PAVcVertex@@IPAIPAVcITriangle@@I2PAV?$vector@PAVcIndexArray@@V?$allocator@PAVcIndexArray@@@stlport@@@s tlport@@PAVcFrustum@@2I@Z) Rendering.obj : error LNK2001: unresolved external symbol "public: bool __thiscall cMatrix4::operator=(class cMatrix4 const &)" (??4cMatrix4@@QAE_NABV0@@Z) Rendering.obj : error LNK2001: unresolved external symbol "class cMatrix4 __cdecl operator*(class cMatrix4 const &,class cMatrix4 const &)" (??D@YA?AVcMatrix4@@ABV0@0@Z) Rendering.obj : error LNK2001: unresolved external symbol "public: class cMatrix4 __thiscall cPoint3::Translate(void)" (?Translate@cPoint3@@QAE?AVcMatrix4@@XZ) Rendering.obj : error LNK2001: unresolved external symbol "public: class cMatrix4 __thiscall cQuaternion::ConvertToMatrix(void)" (?ConvertToMatrix@cQuaternion@@QAE?AVcMatrix4@@XZ) Rendering.obj : error LNK2001: unresolved external symbol "public: bool __thiscall cObject::TestFrustum(class cFrustum *)" (?TestFrustum@cObject@@QAE_NPAVcFrustum@@@Z) Rendering.obj : error LNK2001: unresolved external symbol "public: bool __thiscall cWorldCell::TestFrustum(class cFrustum *)" (?TestFrustum@cWorldCell@@QAE_NPAVcFrustum@@@Z) Rendering.obj : error LNK2001: unresolved external symbol "public: void __thiscall cWorldCell::Cull(class stlport::vector > *,class cFrustum *,class cPoint3 const &,bool)" (?Cull@cWor ldCell@@QAEXPAV?$vector@PAVcIndexArray@@V?$allocator@PAVcIndexArray@@@stlport@@@stlport@@PAVcFrustum@@ABVcPoint3@@_N@Z) UtilMain.obj : error LNK2001: unresolved external symbol "class cPoint3 __cdecl operator*(class cMatrix4 const &,class cPoint3 const &)" (??D@YA?AVcPoint3@@ABVcMatrix4@@ABV0@@Z) UtilMain.obj : error LNK2001: unresolved external symbol "bool __cdecl operator==(class cPoint3 const &,class cPoint3 const &)" (??8@YA_NABVcPoint3@@0@Z) UtilMain.obj : error LNK2001: unresolved external symbol "class cPoint3 __cdecl operator+(class cPoint3 const &,class cPoint3 const &)" (??H@YA?AVcPoint3@@ABV0@0@Z) LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 Debug/MyGame.exe : fatal error LNK1120: 21 unresolved externals Error executing link.exe. could anyone explain what causes this error and possibly how to fix it..

Share this post


Link to post
Share on other sites
When you try use one of your functions the compiler can''t find the correct function to link with, you probably didn''t include the files correctly.

main.cpp : #include "class.h"
class.cpp : #include "class.h"
clsss.h

Share this post


Link to post
Share on other sites
All includes are just fine.. if they werent im pretty sure it would strike an include error before if ithadnt found something

and if you are reffering to some function who is declared and isnt there... i checked couple of them and they seemed to be alright

Share this post


Link to post
Share on other sites
You''ve got a couple of errors there.

The first one is that you''re either not linking to a library that provides all that math for you, or you''ve not included the .cpp files in your project.

The other is that you''ve got a main instead of a WinMain, or have chosen a Windows App instead of a Windows Console App by mistake.


Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions

Share this post


Link to post
Share on other sites
im not sure about the WinMain/main thing but i can tell for sure i have the cpp file with ConvertToAxisAngle() definition included(i triple-checked) so any other good ideas?

Update: Just remmembered i havent gotten around to WinMain yet so that error was expected.. but the others?

[edited by - Velochy on August 18, 2002 10:33:13 AM]

Share this post


Link to post
Share on other sites
"The first one is that you''re either not linking to a library that provides all that math for you, or you''ve not included the .cpp files in your project."

Same answer. Some .cpp or .lib file/s have these. Now add it/them to your project.


Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions

Share this post


Link to post
Share on other sites
unless math.h needs an external lib (since the mentioned function uses acos and sin and a couple of other things from math.h) i can safely assure you i have included the cpp file which contains the definitions of these functions with which it reports the errors. the files containing functioins compile with no errors(besides few double-to-float conversion warnings that is) and only use standard operators and few things included with math.h


[edited by - Velochy on August 18, 2002 5:48:38 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by Velochy
.. i have the cpp file with ConvertToAxisAngle() definition


You need the definition of void __thiscall cQuaternion::ConvertToAxisAngle(void) not ConvertToAxisAngle()

just incase if you''ve forgot the syntax...

Share this post


Link to post
Share on other sites
this might sound wierd (im assuming MSVC6?), try going using clean in the Build Menu, then just re-compile
(menu)Build->(item)Clean->(keypress)F7

if that dosnt work, double check that the actual Quaterion.cpp
&.h file are actually included in the project (its soo easy to
miss this) and make sure Quaterion.h is included in Quaterion.cpp

just checking :D
/ silvermace

Share this post


Link to post
Share on other sites
as far as i can see both MathClasses.cpp and MathClasses.h are in the project - they are in the file view screen under project and their settings can be changed with "Project Settings".
as for the ConvertToAxisAngle... i meant class cQuaternion::ConvertToAxisAngle() - as for __thiscall and the other weird stuff.. i have no idea what they are but i didint write them in the code so i assume theyre default

Update: and the clean didnt work either (under linux clean got rid of the files going to be linked and if it does this with MSDEV 6 too then i really fail to see the point of it in the case of current errors - rebuild would have been just as good(i think))

[edited by - Velochy on August 19, 2002 2:30:07 AM]

Share this post


Link to post
Share on other sites