Use DX9SDK to build DirectX environment for VS2008 _include

Source: Internet
Author: User

The following three main prerequisites are required for a DirectX program to compile and link correctly

One install DirectX SDK

Two proper configuration. h file path and. lib file path

Three correct links required. lib file


Detailed steps are as follows:


I. Installing the DirectX SDK http://msdn.microsoft.com/en-us/directx/aa937788

Two. Correctly configure the. h file and the. lib File path

1. Start vs, select Tools-option-projects and Solutions-vc++directories in turn, and there are several options under Show directories for

(This step may appear "VC + + directory editing function has been rejected" situation, we can not adopt this scheme into the vc++directories, instead of using the following scenario:

Execute < View >--< Property Manager in the menu bar, and in the newly appearing property manager workspace, click Item->debug| Win32->microsoft.cpp.win32.userdirectories can be opened vc++directories)

2. Select Include files, which is the location of the DirectX header file, click the New Folder button below to enter the path of the DirectX header file. It's in my place.

C:/Program Files/microsoft DirectX SDK (March 2008)/include

3. Select the library fies, which is where the. lib file is located, and type the path of the DirectX. lib file into my

C:/Program Files/microsoft DirectX SDK (March 2008)/lib/x86

Here, if you include all the. h files you need, your program should be compiled without problems, but when you connect you'll probably find a whole bunch of unresolved external symbols ... Error. Because you haven't linked Lib file yet

Note that these are the settings for the entire solution, that is, the prject that you create later will apply the above settings, and if you want to set up for project, use the following method. Three. Link the required. lib file correctly

1. In Solution view, right click on your project, choose Properties-configuration properties-linker-input-addtional Dependencies

2. Click on the Small button on the right to add the following commonly used LIB files

Dxerr.lib
Dxguid.lib
D3dx9d.lib
D3dx10d.lib
D3d9.lib
Winmm.lib
Comctl32.lib



Here, the configuration of the DirectX development environment in VS2010 is complete.


The added point is to select "Use multibyte Character set" in the project properties-> Configuration Properties-> The general-> character set if prompted for conversion errors




Error C2146: syntax error: Missing ";" (in front of the identifier "PVOID64") [Turn] Error C2146: syntax error: Missing ";" (in front of the identifier "PVOID64") Source: Http://houjixin.blog.163.com/blog/static/356284102009112395049370/DirectShow 2009-12-23 09:50:49 Read 311 Comments 0 font Size: Big small open winnt.h file, found that the problem is in the WinNT.h header file without the definition of pointer_64 caused. Search VC under the header file, found in the Basetsd.h header file has a pointer_64 definition, and in the WinNT.h header file also contains the header file. There are also basetsd.h headers in the Dxsdk9, and the file has no pointer_64 definition, so the compilation does not pass. After adjusting the header file search order, the compilation is not good, originally in the VC6 directory also has basetsd.h header file, and the file has no pointer_64 definition. Because the VC6 include directory is available in the system variable include, changing the header file search order in VS does not solve the problem. Finally, I winnt.h in the #include change to "basetsd.h" on it.


Error C2146:syntax error:missing '; ' before identifier ' PVOID64 '

Error C2146:syntax error:missing &apos;; &apos; Before identifier &apos; pvoid64&apos;
Caused by the DirectDraw upgrade

Check the information on the Internet, the general solution is:

Workaround: Add the following statement to the WinNT.h

#define POINTER_64 __ptr64

typedef void *pvoid;
typedef void * Pointer_64 PVOID64;

Personally think it best not to change winnt.h.
Sometimes you need to adjust the order of the include folders to solve the problem, winnt.h in the Platform SDK
DDK in the vc6.0, there are several winnt.h with their own. The winnt.h versions used in DXSDK are different.

Solve this problem by adjusting the IDE tool-> option-> Project VC + + directory, including the order of file include
The folder where the DXSDK needs to be winnt.h is on top.

You can move it to the bottom of the Include folder.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.