VS2010/DirectX linkage errors
#1 Members - Reputation: 100
Posted 23 August 2011 - 10:22 AM
I have set up the directory in the project's properties and i've checked to make sure they match in both debug and release.
Can anyone help me?
Cheers, Matt
#3 Members - Reputation: 1595
Posted 23 August 2011 - 11:05 AM
MSDN: Linker Tools Error LNK2001.
But since you insist, let's play the GameDev.net hint pleaing game..
Can you list which symbols you are missing?
Do you know which library files they are supposed to be located in?
Have you checked you are not missing an important library?
Which library files are you linking to in release? Which ones are you linking to in debug mode?
Which header files did you include to reference the missing symbols?
If you built the libraries yourself, are you sure you matched the signatures when building and referencing the library (C/C++ preprocessor settings match)?
#4 Members - Reputation: 100
Posted 23 August 2011 - 12:19 PM
Here are the errors:
Error 6 error LNK2001: unresolved external symbol _IID_IDirectInput8A C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 -Prog For Games\DirectInput.obj Building 9 - Project 1
Error 1 error LNK2001: unresolved external symbol _GUID_SysMouse C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\DirectInput.obj Building 9 - Project 1
Error 3 error LNK2001: unresolved external symbol _GUID_SysKeyboard C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\DirectInput.obj Building 9 - Project 1
Error 24 error LNK2001: unresolved external symbol _DXGetErrorStringA@4 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Utility.obj Building 9 - Project 1
Error 25 error LNK2001: unresolved external symbol _DXGetErrorDescriptionA@4 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Utility.obj Building 9 - Project 1
Error 4 error LNK2001: unresolved external symbol _DirectInput8Create@20 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\DirectInput.obj Building 9 - Project 1
Error 14 error LNK2001: unresolved external symbol _Direct3DCreate9@4 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 9 error LNK2001: unresolved external symbol _D3DXMatrixTranslation@16 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 20 error LNK2001: unresolved external symbol _D3DXMatrixScaling@16 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Mesh.obj Building 9 - Project 1
Error 18 error LNK2001: unresolved external symbol _D3DXMatrixRotationZ@8 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Mesh.obj Building 9 - Project 1
Error 16 error LNK2001: unresolved external symbol _D3DXMatrixRotationY@8 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 19 error LNK2001: unresolved external symbol _D3DXMatrixRotationX@8 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Mesh.obj Building 9 - Project 1
Error 11 error LNK2001: unresolved external symbol _D3DXMatrixPerspectiveLH@20 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 15 error LNK2001: unresolved external symbol _D3DXMatrixPerspectiveFovLH@20 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 13 error LNK2001: unresolved external symbol _D3DXMatrixMultiply@12 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 7 error LNK2001: unresolved external symbol _D3DXMatrixLookAtLH@16 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 27 error LNK2001: unresolved external symbol _D3DXLoadMeshHierarchyFromXA@28 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\XfileEntity.obj Building 9 - Project 1
Error 22 error LNK2001: unresolved external symbol _D3DXLoadMeshFromXA@32 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Mesh.obj Building 9 - Project 1
Error 21 error LNK2001: unresolved external symbol _D3DXGetFVFVertexSize@4 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Mesh.obj Building 9 - Project 1
Error 26 error LNK2001: unresolved external symbol _D3DXFrameFind@8 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\XfileEntity.obj Building 9 - Project 1
Error 28 error LNK2001: unresolved external symbol _D3DXFrameDestroy@8 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\XfileEntity.obj Building 9 - Project 1
Error 29 error LNK2001: unresolved external symbol _D3DXFrameCalculateBoundingSphere@12 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\XfileEntity.obj Building 9 - Project 1
Error 8 error LNK2001: unresolved external symbol _D3DXCreateTextureFromFileA@12 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 12 error LNK2001: unresolved external symbol _D3DXCreateSprite@8 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 23 error LNK2001: unresolved external symbol _D3DXCreateFontA@48 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\UI.obj Building 9 - Project 1
Error 17 error LNK2001: unresolved external symbol _D3DXComputeBoundingBox@20 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Mesh.obj Building 9 - Project 1
Error 5 error LNK2001: unresolved external symbol _c_dfDIMouse2 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\DirectInput.obj Building 9 - Project 1
Error 2 error LNK2001: unresolved external symbol _c_dfDIKeyboard C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\DirectInput.obj Building 9 - Project 1
Error 10 error LNK2001: unresolved external symbol __imp__timeGetTime@0 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
I don't really know anything about libraries, so sorry for being a bit useless with information.
What specific things should I be looking at in the config?
#5 Members - Reputation: 152
Posted 23 August 2011 - 01:22 PM
This will fix it :
#pragma comment(lib, "d3d9.lib") #pragma comment(lib, "d3dx9.lib") // if i remember correct #pragma comment(lib, "winmm.lib") #pragma comment(lib, "dinput8.lib") #pragma comment(lib, "dxguid.lib")
Edit : i was still editing my post, but clb found the libs before me : )
Edited by Jeffreyp, 23 August 2011 - 01:32 PM.
#6 Members - Reputation: 1595
Posted 23 August 2011 - 01:24 PM
I remember DXGetErrorString are in DxErr.lib, or DxErr9.lib. Those GUID identifiers are in dxguid.lib.
Double check that you are linking against those libraries in release, in addition to just linking to d3d9.lib.
#7 Members - Reputation: 1595
Posted 23 August 2011 - 01:26 PM
Also, you seem to have some DirectInput stuff from dinput8.lib.
#8 Members - Reputation: 100
Posted 23 August 2011 - 01:40 PM
Also I have 2 errors left. I pressume these are from a library which is in a different folder. How do i go about linking this? Sorry for the questions, I am a complete beginner in terms of this sort of stuff.
#10 Members - Reputation: 100
Posted 23 August 2011 - 01:47 PM
Errors:
Error 1 error LNK2001: unresolved external symbol _DXGetErrorStringA@4 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Utility.obj Building 9 - Project 1
Error 2 error LNK2001: unresolved external symbol _DXGetErrorDescriptionA@4 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Utility.obj Building 9 - Project 1
I have a library file in a seperate folder which I think is causing the problem, it's a custom library we were using as a temp for animation before we learn how to do it ourselves.
#12 Members - Reputation: 100
Posted 23 August 2011 - 04:35 PM
#pragma comment(lib, "DxErr9.lib")
This gives a popup during compilation saying:
"Debugging information for 'Building 9 - Project 1.exe' cannot be found or does not match...
...do you want to continue debugging?"
Choosing yes, starts the game.
I have a folder for XAnimator, the stuff we are using for animation, which contains it's own custom library. Is it the linking of the stuff here causing the problem?
#14 Members - Reputation: 3828
Posted 24 August 2011 - 03:02 AM
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.
#15 Members - Reputation: 100
Posted 24 August 2011 - 04:26 AM
Mhagain, I have set up the libraries like you have said already, but that didn't work and I don't know why, so looks like it's staying with the #pragmas for now.
As an attempt for me to learn a bit more about the compiler options and whatnot, here are some things which are the same in debug and release. should they be?
- All of the VC++ options
- Linker > Additional library directories
- ASM list location --> Debug: .\debug/ --> Release: $(IntDir)
- object file name --> Debug: .\debug/ --> Release:$(IntDir)
- Program database file name --> Debug: .\debug/ --> Release:$(IntDir)vc$(PlatformToolsetVersion).pdb






