Jump to content

  • Log In with Google      Sign In   
  • Create Account


How to set visual studio 10.0 to work with directx


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 matre   Members   -  Reputation: 100

Like
0Likes
Like

Posted 02 January 2010 - 06:21 AM

Please help i get an error while compilling 1>sdk.cpp(6): fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory I am new to directx so please help. My program include files look like: #include <StdAfx.h> #include <windows.h> #include <windowsx.h> #include <d3d9.h> #include <d3dx9.h> And #include <d3dx9.h> is underlined with red curved line.Please help. Thanks in advance.

Sponsor:

#2 nobodynews   Crossbones+   -  Reputation: 1804

Like
2Likes
Like

Posted 02 January 2010 - 06:43 AM

You'll want to go to "Project" then "Properties" then "VC++ Directories". You'll want to add the "include" folder and the "lib" folder to the top of the "include directories" and "library directories" from the direct x SDK installation directory. The 'lib' folder you'll most likely be interested in will be the x86 subdirectory of the lib folder. In summary, you'll probably have these directories added:

include-->C:\Program Files (x86)\Microsoft DirectX SDK (March 2009)\Include
library-->C:\Program Files (x86)\Microsoft DirectX SDK (March 2009)\Lib\x86

or wherever they are on your hard drive.

#3 nobodynews   Crossbones+   -  Reputation: 1804

Like
0Likes
Like

Posted 02 January 2010 - 06:49 AM

Oh, and I forgot you'll probably need to inform the compiler of which .lib files you want to link against. You do this at "project", "properties", "linker->input", and "additional dependencies". Then you'll need to mention all the .lib files you are using, probably D3dx9.lib and D3d9.lib

#4 chetanjags   Members   -  Reputation: 173

Like
0Likes
Like

Posted 02 January 2010 - 06:50 AM

Go to ProjectProperties -> Linker->Input->addional dependencies and include
d3dx9.lib

If you get to same error again then check directx path in Visual Studio.
Refer to this link for detailed information on setting up directx with vc++ -
http://www.uc-forum.com/forum/programming-beginners/61112-setting-up-vc-and-directx.html

#5 nobodynews   Crossbones+   -  Reputation: 1804

Like
0Likes
Like

Posted 02 January 2010 - 06:58 AM

Quote:
Original post by Chetanhl
Go to ProjectProperties -> Linker->Input->addional dependencies and include
d3dx9.lib

If you get to same error again then check directx path in Visual Studio.
Refer to this link for detailed information on setting up directx with vc++ -
http://www.uc-forum.com/forum/programming-beginners/61112-setting-up-vc-and-directx.html


First, he obviously didn't have the paths set up correctly because his error was about not finding a header file. He would eventually need to follow your instructions after fixing the compile time error, but you jumped the gun a bit :). Second of all, that forum gives instructions for pre-2010 versions of Visual Studio. The method of setting up include/library directories has changed since 2008 was released. It now must be set up for every project in the project properties section instead of in the application options.

#6 matre   Members   -  Reputation: 100

Like
0Likes
Like

Posted 02 January 2010 - 07:19 AM

Guys I had done everything you said,but now i get 3 new errors:
1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\objidl.h(11280): error C2061: syntax error : identifier '__RPC__out_xcount_part'
1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\objidl.h(11281): error C2059: syntax error : ')'
1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\objidl.h(11281): fatal error C1903: unable to recover from previous error(s); stopping compilation
Please help.

#7 matre   Members   -  Reputation: 100

Like
0Likes
Like

Posted 02 January 2010 - 07:26 AM

PS.
I found many tutorials on setting directx settings for visual studios 2008(or before)but none for visual c++ 2010 express so please take that in mind please.
Thank you.

#8 matre   Members   -  Reputation: 100

Like
0Likes
Like

Posted 06 January 2010 - 12:41 AM

Please help anybody.

#9 merkaba48   Members   -  Reputation: 100

Like
0Likes
Like

Posted 24 January 2010 - 09:47 AM

I was having problems with finding the d3dx9.lib and header file too. I realised I was putting the Include and Library/x86 folders into the wrong part of the settings (This is with Visual C++ Express Studio 2010)

Here is what you should do, then what you shouldn't:

Go into Project -> Properties -> VC++ Directories

In the 'Include Directories' section, select your Program Files\Microsoft DirectX SDK\Include directory
In the 'Library Directories' section, select your Program Files\Microsoft DirectX SDK\lib\x86

That should be ALL you have to do (in my case, anyway).

What you should NOT do, and what I think is the cause of many people having problems is:

(Do not!) Go into Project -> Properties -> C/C++ -> General
(Do not!) In the 'Additional Include Directories', put in your Include folder and Library folders.

Doing that will result in it asking for d3dx9.lib, which must be specified in the correct manner shown above.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS