d3dx11.lib找不到? [英] d3dx11.lib not found?

查看:83
本文介绍了d3dx11.lib找不到?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Windows 8/Visual Studio 2012,C ++ 11和Direct3D 11进行开发.

I'm using Windows 8 / Visual Studio 2012, C++11 and Direct3D 11 for development.

我包括这样的Direct3D库

I include the Direct3D libraries like this

#pragma comment(lib, "dxgi.lib")
#pragma comment(lib, "d3d11.lib")
#pragma comment(lib, "d3dx11.lib") // <-- error LNK1104: cannot open file 'd3dx11.lib'
#pragma comment(lib, "d3dx10.lib")

但是,链接器似乎找不到 d3dx11.lib .将库所在的路径添加到项目的库目录"后,链接器仍然找不到那些文件.即使我将lib文件复制到项目目录本身后,也无法使用.

However, the linker can't seem to find the d3dx11.lib. After adding the path where the library is located to the 'Library directories' of the project, the linker still can't find those files. Even after I copied the lib files into the project directory itself, it doesn't work.

从2010年6月起,我安装了Windows 8 SDK和DirectX SDK.我是否遗漏了任何东西?

I installed the Windows 8 SDK as well as the DirectX SDK from June 2010. Am I missing anything?

推荐答案

当我自己处理这个问题时,我从这里开始:

When dealing with this myself, I started here:

DirectX SDK在哪里?

然后-在该页面的中间,阅读有关DirectXMath的信息:

then - in about the middle of that page, reading about DirectXMath:

DirectXMath

几乎包括正确的头文件,并将"D3DX"前缀更改为"XM".并不是那么简单,但这是一般的想法.

It's pretty much just including the right header files and changing "D3DX" prefixes to "XM". Not quite that simple, but that's the general idea.

您的第一个程序可能包含以下内容/用法:

Your first program will probably have inclusions/usings like this:

#include <d3d11.h>
#include "DirectXMath.h"
#include "DirectXPackedVector.h"

using namespace DirectX; 
using namespace DirectX::PackedVector;

struct mystruct
{
   DirectX::XMFLOAT3 position;
   DirectX::PackedVector::HALF packedValue;
};

当然,使用命名空间"并不是最佳实践,但是在这种情况下,我发现程序每一行上的"DirectX ::"正使我的程序几乎无法读取-所以我选择了使用".

Of course, it's not considered best practice to have "using namespace", but in this one instance I found that "DirectX::" on every line of my program was making my program almost impossible (for me) to read - so I went with the "using".

祝你好运!

这篇关于d3dx11.lib找不到?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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