Help, cant compile anything that uses dx10

Started by
6 comments, last by moose517 16 years, 3 months ago
I finally decided to do programming in dx10. I bought a book that covers it, i'm trying to compile the code that came with the book and i am having some issues with it. I'm getting the following error. I have all the libaries linked in and all files included. Error 1 error LNK2019: unresolved external symbol _D3D10CreateDeviceAndSwapChain@32 referenced in function "bool __cdecl InitDirect3D(struct HWND__ *,int,int)" (?InitDirect3D@@YA_NPAUHWND__@@HH@Z) winMain.obj I have the following libraries linked: d3d10.lib d3dx10d.lib winmm.lib the following files were included: #include <windows.h> #include <tchar.h> #include "resource.h" #include <d3d10.h> #include <d3dx10.h> Am i missing a file or library or is something else wrong.
Advertisement
That looks fine to me - those two headers/libs should do the trick. Are you absolutely sure that all build profiles are using these libraries? I've screwed myself up before by changing the 'debug' profile's linker settings and forgetting to change the 'release' profile.

Also, are you sure your SDK is matching up and installed correctly?

Cheers,
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Yeah, I'm sure that the SDK is installed correctly because i can compile code that uses dx9.
Ok, i got it, i had the x64 files linked instead of the x86. My biggest question now is why? I'm running a 64-bit OS on all 64-bit hardware, shouldn't i have to use the 64 bit libraries. I had the same problem with pythons IDLE. Can someone explain why i have to use the incorrect version for my computer. I am running windows vista 64-bit ultimate
I'm not 100% sure if you're using VS or not (the error message makes it seem like you are) but if you are check your configuration platform (just an idea).
wow, that was it, i forgot to change to configuration manager, now i'm getting an error that it can't find d3d10.h, are the includes files also bit version dependent or does it matter? sorry if these questions sound dumb, i had 32-bit OS's before i built my computer this summer
Quote:Original post by moose517
wow, that was it, i forgot to change to configuration manager, now i'm getting an error that it can't find d3d10.h, are the includes files also bit version dependent or does it matter? sorry if these questions sound dumb, i had 32-bit OS's before i built my computer this summer
You need to set up your paths for x64 and Win32 seperately.

Assuming VS2005, go to Tools -> Options -> Projects and Solutions -> VC++ Directories, and make sure the "Platform" drop list matches the path to the files (Include files and source will be the same for Win32 and x64, libs and possibly bin files will be different). x64 should use the 64-bit version of the files, Win32 should use the 32-bit ones.

For example. my DX9 lib directories are set up as:
Win32: E:\Microsoft DirectX SDK (August 2006)\Lib\x86
x64: E:\Microsoft DirectX SDK (August 2006)\Lib\x64
thanks guys, i got it working now, I feel like an idiot though, i guess i am just used to 32-bit cause i didn't have to do much different

This topic is closed to new replies.

Advertisement