Skip to main content
gamedev.net
🔒 Locked

Linker problems

Started by DTKubina 3 replies 600+ views
Original Post
DTKubina
DTKubina
Ok, here we go. I''ve exhausted all my ideas on this so PLEASE help me out. I have #include to 2 header files, #include "d3d8.h" and #include "d3dx8.h". These files are located in the DXSDK folder on my C drive, pretty standard so far. I''ve linked both the include and lib folders under tools/options/projects/directories. Still with me? Then how is it that I keep getting these? error LNK2019: unresolved external symbol _D3DXMatrixLookAtLH@16 referenced in function "int __cdecl DoInit(void)" (?DoInit@@YAHXZ) error LNK2019: unresolved external symbol _D3DXMatrixPerspectiveFovLH@20 referenced in function "int __cdecl DoInit(void)" (?DoInit@@YAHXZ) error LNK2019: unresolved external symbol _Direct3DCreate8@4 referenced in function "int __cdecl DoInit(void)" (?DoInit@@YAHXZ) error LNK2019: unresolved external symbol _D3DXMatrixRotationY@8 referenced in function "int __cdecl DoFrame(void)" (?DoFrame@@YAHXZ) error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function "int __cdecl DoFrame(void)" (?DoFrame@@YAHXZ) error LNK2019: unresolved external symbol _D3DXMatrixMultiply@12 referenced in function "int __cdecl DoFrame(void)" (?DoFrame@@YAHXZ) error LNK2019: unresolved external symbol _D3DXMatrixTranslation@16 referenced in function "int __cdecl DoFrame(void)" (?DoFrame@@YAHXZ) error LNK2019: unresolved external symbol _D3DXMatrixTranspose@8 referenced in function "int __cdecl DoFrame(void)" (?DoFrame@@YAHXZ) error LNK2019: unresolved external symbol _D3DXCreateTextureFromFileA@12 referenced in function "int __cdecl SetupParticles(void)" (?SetupParticles@@YAHXZ) I know that most of these are in the d3dx8math.h that is included in the d3dx8.h, so why the hell can''t the compiler find the definitions for these functions? DTKubina
DTKubina
ShadowCoder
ShadowCoder
The compiler IS finding them, so your includes are ok. The linker is not finding them so your lib setup is wrong.

I link with the following:

dsound.lib dinput8.lib dxerr8.lib d3dx8dt.lib d3d8.lib d3dxof.lib dxguid.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

You set these in project/settings link tab for debug and release.

d3dx8dt.lib is the one with these in it. But they are also in
other libs. Do a file find for *.lib containing _D3DXMatrixLookAtLH and you'll see them.

Your path could also be wrong.



Shad

[edited by - ShadowCoder on October 5, 2002 9:05:23 PM]
DTKubina
DTKubina
Thanks Shad,

I''m using VC++.net so I think my setup is a bit different. The only way I can figure out how to link any files to my project is through tools/options/projects/directories and then go to the libraries or include section. Is there another way that i''m not seeing? I did a search for the _D3DXMatrixLookAtLH and it was in one of the libraries in the directory C:\DXSDK\lib that I had specified. I must be missing something, but I can''t tell what!



DTKubina
DTKubina
Matt Calabrese
Matt Calabrese
You have to go into project SETTINGS and actually type in the lib''s. Setting a directory only tells MSVC++ where to look when you explicitly provide the name of a static library in your project settings.
DTKubina
DTKubina
YEEEEEHAAAAAA!!!!!! HHHHOOOLLLYYY SSSHHH***TTT!!!!

That got it!, Thanks Matt and Shad!!!

DTKubina
DTKubina

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.