Home » Community » Forums » DirectX and XNA » Help, cant compile anything that uses dx10
Intel sponsors gamedev.net search:
Control Panel Register Bookmarks Who's Online Active Topics Stats FAQ Search

Add Forum to Favorites |  Send Topic To a Friend | View Forum FAQ | Track this topic


 Last Thread Next Thread 
 Help, cant compile anything that uses dx10
Post New Topic  Post Reply 
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.

 User Rating: 1014   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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


Jack Hoxley [ Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]

 User Rating: 1940   |  Rate This User  Send Private MessageView ProfileView Journal Report this Post to a Moderator | Link

Yeah, I'm sure that the SDK is installed correctly because i can compile code that uses dx9.

 User Rating: 1014   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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

 User Rating: 1014   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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).

 User Rating: 1031   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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

 User Rating: 1014   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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


 User Rating: 2012   |  Rate This User  Send Private MessageView ProfileView JournalView GD Showcase Entries Report this Post to a Moderator | Link

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


 User Rating: 1014   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

All times are ET (US)

Post Reply
 Last Thread Next Thread 
Forum Rules:
You may not post new threads
You may post replies
You may not edit your posts
You may not use HTML in your posts
Jump To:
Administrative Options: