Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 20943
  • Last Modified:

LNK2001 and LNK2019 with DirectX 8.1

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
Moozh
Asked:
Moozh
1 Solution
 
nonubikCommented:
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
 
MoozhAuthor Commented:
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now