Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

LNK2001 and LNK2019 with DirectX 8.1

Posted on 2004-09-23
2
Medium Priority
?
20,931 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
nonubik earned 500 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

705 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