无法打开DirectX包含文件(DXSDK_DIR不起作用) [英] Cannot open DirectX include files (DXSDK_DIR not working)

查看:346
本文介绍了无法打开DirectX包含文件(DXSDK_DIR不起作用)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Windows 7,刚刚下载/安装了vs 10 Express C ++,Windows sdk 7.1 + .net 4,DirectX六月.自从恢复中重新安装操作系统以来,没有以前的安装.

I have windows 7, and just downloaded/installed vs 10 express c++, windows sdk 7.1+.net 4, directx june.  with no previous installations since reinstalling os from recovery.

我试图编译DirectX教程,找不到DirectX标头,所以我验证了DirectX目录在项目属性下的新位置中列出,对于这3个类别,它的名称为$(DXSDK_DIR).所以我将其更改为c:/program files ... directx 六月,无论它是什么,我都复制并粘贴了.而且有效.

I tried to compile the directx tutorial, coulnd't find a directx header, so I verified that the directx dir was listed in the new spot under project properties, it is as $(DXSDK_DIR) for the 3 categories.  So I changed it to c:/program files...directx june/ whatever it is, i copied and pasted. And it worked.

 

我继续学习第二个教程,遇到了同样的问题,并认为我应该修复它,而不是每次都输入文字.

I moved on to the 2nd tutorial and ran into the same problem and figured I should fix it instead of putting in the literal every time.

该路径在项目目录中以DXSDK_DIR的形式列出,因此我检查了环境变量(控制面板),发现DXSDK_DIR已正确定义为指向6月目录.我运行了一个命令提示符,也在那里找到了它.

The path is listed in the project directories as DXSDK_DIR, so I checked the enviroment vars (control panel) and found DXSDK_DIR to be defined correctly pointing to the june directory.  I ran a command prompt and found it there too.

我不知道为什么VS在编译时没有找到它,但是当我进入文字目录时找到了它.好像没有为编译器定义DXSDK_DIR var,但是当控制面板级别知道它时,这没有任何意义.

I can't figure out why VS is not finding it while compiling, but finds it when I enter the literal directory.  Seems like the DXSDK_DIR var is not defined for the compiler, but that does not make sense when the control panel level knows about it.

推荐答案

默认情况下,Visual Studio无法识别此环境变量.但是您可以在Visual Studio中全局配置此路径,而不是在每个单独的项目中进行配置.

Visual Studio does not recognize this environment variable by default. But you can configure this path globally in Visual Studio instead of each individual project.

在Visual Studio 2010 RTM中,

In Visual Studio 2010 RTM,

  1. 点击工具"->选项".
  2. 扩展项目和解决方案.
  3. 选择VC ++目录.
  4. 在下拉菜单中选择包含".
  5. 附加DirectX包含目录.我相信您也可以在此处使用
  1. Click on Tools->Options.
  2. Expand Projects and Solutions.
  3. Select VC++ Directories.
  4. Select Includes in the drop-down.
  5. Append the DirectX include directory. I believe you can also use


(DXSDK_DIR)\ Include(或只是"Inc",不确定它们使用的是哪个).
  • 重复4和5,但要使用库/"lib".
  • (DXSDK_DIR)\Include (or just "Inc", not sure which they use) here.
  • Repeat 4 and 5 but for Libraries/"lib".
  • 在Visual Studio 2010 SP1中,

    In Visual Studio 2010 SP1,

    1. 请阅读标题为"VC ++目录更改"的部分.在中 http://blogs.msdn.com/b/vcblog/archive/2010/03/02/visual-studio-2010-c-project-upgrade-guide.aspx .
    1. Please read the section titled "VC++ Directories Change" in http://blogs.msdn.com/b/vcblog/archive/2010/03/02/visual-studio-2010-c-project-upgrade-guide.aspx.


    这篇关于无法打开DirectX包含文件(DXSDK_DIR不起作用)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆