Jump to content
  • Advertisement
Sign in to follow this  
Paul-K

Stupid microsoft (actually me), please help me [Solved]

This topic is 3687 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

Hello all, Currently, i'm trying to start with directX. But microsoft is making it very difficult for me. I downloaded via the directx sdk some examples and tried to compile them via visual C++ 2008 express edition. I'v got the following errors: 1>------ Build started: Project: Matrices, Configuration: Debug Win32 ------ 1>Compiling... 1>Matrices.cpp 1>Compiling resources... 1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1 1>Copyright (C) Microsoft Corporation. All rights reserved. 1>Linking... 1>Matrices.obj : error LNK2019: unresolved external symbol _Direct3DCreate9@4 referenced in function "long __cdecl InitD3D(struct HWND__ *)" (?InitD3D@@YAJPAUHWND__@@@Z) 1>Matrices.obj : error LNK2019: unresolved external symbol _D3DXMatrixPerspectiveFovLH@20 referenced in function "void __cdecl SetupMatrices(void)" (?SetupMatrices@@YAXXZ) 1>Matrices.obj : error LNK2019: unresolved external symbol _D3DXMatrixLookAtLH@16 referenced in function "void __cdecl SetupMatrices(void)" (?SetupMatrices@@YAXXZ) 1>Matrices.obj : error LNK2019: unresolved external symbol _D3DXMatrixRotationY@8 referenced in function "void __cdecl SetupMatrices(void)" (?SetupMatrices@@YAXXZ) 1>Debug/Matrices.exe : fatal error LNK1120: 4 unresolved externals 1>Build log was saved at "file://c:\Users\XXXX\Documents\Visual Studio Projects\Matrices\Debug\BuildLog.htm" 1>Matrices - 5 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== [Edited by - Paul-K on November 5, 2008 10:55:02 AM]

Share this post


Link to post
Share on other sites
Advertisement
hi,

the linker can't find certain symbols which are located in the DirectX library. you have to link with the respective libraries so the linker can find these functions.

let me know if you need more help,
-tiv

Share this post


Link to post
Share on other sites
Forum FAQ's are awesome.

I don't understand how Microsoft are holding you back. After all, who provided you with a compiler, IDE and set of libraries? [grin]

Share this post


Link to post
Share on other sites
if you go to %DirectSdkInstallPath%\Lib\x86 you'll find the static libraries which you have to link to your application.

you'll probably need:
"d3d9.lib"
"d3dx9.lib" (for release, "d3dx9d.lib" for debug builds)

and maybe "dxguid.lib", but I'm not sure about that.


to add static libraries to your project, go to the "Properties"-page of your project: "Linker -> Input -> Additional Dependencies". there you have to enter all the libraries you need. under "Linker -> General -> Additional Library Directories" you can specify additional paths in which to look for libraries, but normally the DirectX SDK should have setup the correct paths already.

HTH,
-tiv

Share this post


Link to post
Share on other sites
Quote:
Original post by rip-off
Forum FAQ's are awesome.

I don't understand how Microsoft are holding you back. After all, who provided you with a compiler, IDE and set of libraries? [grin]
In addition to that, check that you've added the lib/x86 directory to your libraries path in Visual Studio, not just "lib", like so:

Share this post


Link to post
Share on other sites
O-M-G What am i sstupid, i took the x64 files blindness because i have a x64 OS but you must of course not look to that :P

Thx all, stupid mistake of me

Share this post


Link to post
Share on other sites
you can use the x64 libs if you have the build configuration set to x64 as well otherwise the compiler looks for the x86 versions. i had that same problem back when i started as well.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!