Jump to content
  • Advertisement
Sign in to follow this  
moose517

Help, cant compile anything that uses dx10

This topic is 3813 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 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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!