Solved

LNK2001 and LNK2019 with DirectX 8.1

Posted on 2004-09-23
2
20,874 Views
Last Modified: 2011-08-18
Hi,

I seem to be running into a similar problem as a lot of people.  The LNK2001 error seems to be the top question in this forum.  I read through the answers but none of them really helped me.  Anyway:

I started with an empty windows project and now have a somewhat completed program using direct3d and directinput (and maybe directdraw?).  I'm using SDK 8.1.

I've compiled my program and run it in debug mode (F5).  I can go to the Debug directory of the project and run the exe from there and it works.  The problem only occurs when I try to do a batch build of the release version.  Then I get the errors listed at the bottom of this post.

For reference, I have gone into the Project -> Linker -> Input and added the following dependencies:

d3dx8.lib d3d8.lib ddraw.lib dinput8.lib d3dxof.lib dxguid.lib

I have no idea why the program works for the debug version but not the release.

Thanks in advance for any help.

Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXMatrixMultiply@12 referenced in function "public: void __thiscall sMesh::CopyFrameToBoneMatrices(void)" (?CopyFrameToBoneMatrices@sMesh@@QAEXXZ)
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXMatrixTranslation@16 referenced in function "public: void __thiscall sAnimation::Update(unsigned long,int)" (?Update@sAnimation@@QAEXKH@Z)
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXMatrixScaling@16 referenced in function "public: void __thiscall sAnimation::Update(unsigned long,int)" (?Update@sAnimation@@QAEXKH@Z)
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXMatrixRotationQuaternion@8 referenced in function "public: void __thiscall sAnimation::Update(unsigned long,int)" (?Update@sAnimation@@QAEXKH@Z)
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXQuaternionSlerp@16 referenced in function "public: void __thiscall sAnimation::Update(unsigned long,int)" (?Update@sAnimation@@QAEXKH@Z)
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXMatrixPerspectiveFovLH@20 referenced in function "public: int __thiscall cGraphics::SetPerspective(float,float,float,float)" (?SetPerspective@cGraphics@@QAEHMMMM@Z)
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXMatrixRotationYawPitchRoll@16 referenced in function "public: int __thiscall cWorldPosition::Rotate(float,float,float)" (?Rotate@cWorldPosition@@QAEHMMM@Z)
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXMatrixTranspose@8 referenced in function "public: int __thiscall cWorldPosition::Update(class cGraphics *)" (?Update@cWorldPosition@@QAEHPAVcGraphics@@@Z)
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXMatrixRotationZ@8 referenced in function "public: int __thiscall cCamera::Rotate(float,float,float)" (?Rotate@cCamera@@QAEHMMM@Z)
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXMatrixRotationY@8 referenced in function "public: int __thiscall cCamera::Rotate(float,float,float)" (?Rotate@cCamera@@QAEHMMM@Z)
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXMatrixRotationX@8 referenced in function "public: int __thiscall cCamera::Rotate(float,float,float)" (?Rotate@cCamera@@QAEHMMM@Z)
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXCreateFontIndirect@12 referenced in function "public: int __thiscall cFont::Create(class cGraphics *,char *,long,int,int,int,int)" (?Create@cFont@@QAEHPAVcGraphics@@PADJHHHH@Z)
Core_Graphics.obj : error LNK2001: unresolved external symbol _IID_IDirectXFileData
Core_Graphics.obj : error LNK2001: unresolved external symbol _IID_IDirectXFileDataReference
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMAnimationKey
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMAnimation
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMAnimationSet
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXCreateTextureFromFileA@12 referenced in function "private: void __thiscall cMesh::ParseXFileData(struct IDirectXFileData *,struct sFrame *,char *)" (?ParseXFileData@cMesh@@AAEXPAUIDirectXFileData@@PAUsFrame@@PAD@Z)
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXComputeBoundingSphere@20 referenced in function "private: void __thiscall cMesh::ParseXFileData(struct IDirectXFileData *,struct sFrame *,char *)" (?ParseXFileData@cMesh@@AAEXPAUIDirectXFileData@@PAUsFrame@@PAD@Z)
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXComputeBoundingBox@20 referenced in function "private: void __thiscall cMesh::ParseXFileData(struct IDirectXFileData *,struct sFrame *,char *)" (?ParseXFileData@cMesh@@AAEXPAUIDirectXFileData@@PAUsFrame@@PAD@Z)
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXLoadSkinMeshFromXof@36 referenced in function "private: void __thiscall cMesh::ParseXFileData(struct IDirectXFileData *,struct sFrame *,char *)" (?ParseXFileData@cMesh@@AAEXPAUIDirectXFileData@@PAUsFrame@@PAD@Z)
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMMesh
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMFrameTransformMatrix
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMFrame
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXGetFVFVertexSize@4 referenced in function "public: unsigned long __thiscall cVertexBuffer::GetVertexSize(void)" (?GetVertexSize@cVertexBuffer@@QAEKXZ)
Core_Graphics.obj : error LNK2019: unresolved external symbol _Direct3DCreate8@4 referenced in function "public: int __thiscall cGraphics::Init(void)" (?Init@cGraphics@@QAEHXZ)
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXCreateSprite@8 referenced in function "public: int __thiscall cGraphics::SetMode(struct HWND__ *,int,int,long,long,char)" (?SetMode@cGraphics@@QAEHPAUHWND__@@HHJJD@Z)
Core_Graphics.obj : error LNK2019: unresolved external symbol _DirectXFileCreate@4 referenced in function "public: int __thiscall cMesh::Load(class cGraphics *,char *,char *)" (?Load@cMesh@@QAEHPAVcGraphics@@PAD1@Z)
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMAnimationOptions
Core_Graphics.obj : error LNK2019: unresolved external symbol _D3DXCreateTextureFromFileExA@56 referenced in function "public: int __thiscall cTexture::Load(class cGraphics *,char *,unsigned long,enum _D3DFORMAT)" (?Load@cTexture@@QAEHPAVcGraphics@@PADKW4_D3DFORMAT@@@Z)
Core_Input.obj : error LNK2019: unresolved external symbol _DirectInput8Create@20 referenced in function "public: int __thiscall cInput::Init(struct HWND__ *,struct HINSTANCE__ *)" (?Init@cInput@@QAEHPAUHWND__@@PAUHINSTANCE__@@@Z)
Core_Input.obj : error LNK2001: unresolved external symbol _IID_IDirectInput8A
Core_Input.obj : error LNK2001: unresolved external symbol _c_dfDIKeyboard
Core_Input.obj : error LNK2001: unresolved external symbol _GUID_SysKeyboard
Core_Input.obj : error LNK2001: unresolved external symbol _c_dfDIMouse
Core_Input.obj : error LNK2001: unresolved external symbol _GUID_SysMouse
Core_Input.obj : error LNK2001: unresolved external symbol _c_dfDIJoystick
Release/Push.exe : fatal error LNK1120: 37 unresolved externals
0
Comment
Question by:Moozh
2 Comments
 
LVL 16

Accepted Solution

by:
nonubik earned 125 total points
ID: 12131345
Seems that Core_Graphics and Core_Input do not link with d3dxb.lib & co.
Are they in the same project as the one you link against those libraries?
Or, have you add those lib references both to Debug and Release project configurations?
0
 

Author Comment

by:Moozh
ID: 12134856
Wow, I feel so stupid.  I didn't even notice you had to set the libraries separately for the Release verion.  Once you mentioned it, I found the problem immediately.  Thanks!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now