Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

byrdJR

i need some help...

This topic is 5666 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i''m trying to learn how to do 3d with DirectX and i''m currently using the book, Programming RPGs with DirectX, but, when I try to compile the examples from chapter 6, I get the lik error messages: Linking... WinMain.obj : error LNK2001: unresolved external symbol _D3DXCreateTextureFromFileA@12 WinMain.obj : error LNK2001: unresolved external symbol _D3DXMatrixLookAtLH@16 WinMain.obj : error LNK2001: unresolved external symbol _D3DXMatrixPerspectiveFovLH@20 WinMain.obj : error LNK2001: unresolved external symbol _Direct3DCreate8@4 WinMain.obj : error LNK2001: unresolved external symbol _D3DXMatrixRotationZ@8 WinMain.obj : error LNK2001: unresolved external symbol __imp__timeGetTime@0 Debug/polygon.exe : fatal error LNK1120: 6 unresolved externals Error executing link.exe. I don''t understand why, because I have the compiler directly linked to the DX sdk and I''m using DX9, so can anyone point me in the right direction? Jim Adams?

Share this post


Link to post
Share on other sites
Advertisement
quote:
WinMain.obj : error LNK2001: unresolved external symbol _D3DXCreateTextureFromFileA@12
WinMain.obj : error LNK2001: unresolved external symbol _D3DXMatrixLookAtLH@16
WinMain.obj : error LNK2001: unresolved external symbol _D3DXMatrixPerspectiveFovLH@20


See those functions start with D3DX. That probably means that you havent linked in d3dx.lib to your project. If you are using visual c++ then add this line of code somewhere

#pragma comment( lib, "d3dx8.lib" )

quote:
WinMain.obj : error LNK2001: unresolved external symbol _Direct3DCreate8@4



#pragma comment( lib, "d3d8.lib" )

quote:
WinMain.obj : error LNK2001: unresolved external symbol __imp__timeGetTime@0



the function timeGetTime is implemented in winmm.lib so add that too
#pragma comment( lib, "winmm.lib" )



also make sure the headers are included
d3d8.h / d3dx8.h


[edit] forgot to add '8' at the end of lib and include names [/edit]

:::: [ Triple Buffer V2.0 ] ::::


[edited by - IFooBar on February 9, 2003 3:31:11 AM]

Share this post


Link to post
Share on other sites
Add the following to WinMain.cpp:

#pragma comment(lib,"d3d8.lib")
#pragma comment(lib,"d3dx8.lib")
#pragma comment(lib,"winmm.lib")

(But IFooBar beat me to it. And was considerably more informative, I might add).


[edited by - Dave Hunt on February 9, 2003 3:35:46 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!