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

Started by
8 comments, last by Paul-K 15 years, 5 months ago
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]
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
Yeah i already tried to do something but i don't think it worked out.

Yes i need more help :)
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]
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
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:
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
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.
Quote:Original post by Paul-K
stupid mistake of me


In that case maybe you should change your thread title ;)
Quote:Original post by BosskIn Soviet Russia, you STFU WITH THOSE LAME JOKES!
Done

But another thing, were are good starting DirectX tutorials?

This topic is closed to new replies.

Advertisement