简体   繁体   English

C ++编译链接

[英]C++ Compiling Linking

I am currently getting into some DirectX Programming and just installed the DX-SDK. 我目前正在学习DirectX编程,并且刚刚安装了DX-SDK。 However, when I open the most basic sample File (Tutorial01, just displays a blue background) in Visual Studio (2012, but that seems to be irrelevant) and compile it I get a working output. 但是,当我在Visual Studio(2012年)中打开最基本的示例文件(Tutorial01,仅显示蓝色背景)时,并进行了编译,得到了有效的输出。

When I start an empty c++ project, make a new file called main.cpp and copy and paste the code from the tutorial, do the same with the resource.h file and also go to Project settings->Configuration Properties->Linker and copy the "Input" from the sample to my own project and then compile my project I get the following error output: 当我启动一个空的c ++项目时,创建一个名为main.cpp的新文件,然后从教程中复制并粘贴代码,对resource.h文件进行相同操作,然后转到“项目设置”->“配置属性”->“链接器”并复制从样本到我自己的项目的“输入”,然后编译我的项目,我得到以下错误输出:

fatal error C1083: Cannot open include file: 'd3dx11.h': No such file or directory

The Header is included via #include in both, the sample and my project. 该示例和我的项目中都通过#include包含了Header。 However my project won't compile. 但是我的项目无法编译。

Your new project is missing VC++ Directories settings to find the DirectX SDK include/lib paths. 您的新项目缺少用于查找DirectX SDK包含/库路径的VC ++目录设置。 Starting with VS 2010, you have to explicitly set up the include/lib paths to get the DirectX SDK integrated with Visual Studio. 从VS 2010开始,您必须显式设置include / lib路径,以将DirectX SDK与Visual Studio集成在一起。

Since you are trying to use VS 2012 with the legacy DirectX SDK, you should be aware that the VC++ Directories settings for VS 2010 are backwards from what you should be using with VS 2012/VS2013. 既然你要使用VS 2012与传统的DirectX SDK,你应该知道的是,VC ++ 2010 VS目录设置向后从你应该VS 2012 / VS2013使用。 This is because the Windows 8.x SDK includes newer versions of most of the DirectX headers in the now outdated and deprecated legacy DirectX SDK. 这是因为Windows 8.x SDK在现在已经过时和过时的旧版DirectX SDK中包括了大多数DirectX标头的较新版本。

The further complication is that D3DX is not present in the Windows 8.x SDK and is itself deprecated. 更复杂的是,D3DX在Windows 8.x SDK中不存在,并且本身已被弃用。 You can make it work per the instructions on MSDN , but keep in mind there are now alternatives to using D3DX for Direct3D 11 you should consider. 您可以按照MSDN上的说明进行操作,但是请记住,您现在应该考虑将D3DX用于Direct3D 11的替代方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM