DX11未解决的外部 [英] DX11 Unresolved Externals

查看:167
本文介绍了DX11未解决的外部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1>------ Build started: Project: Setup, Configuration: Debug Win32 ------
1>BoxDemo.obj : error LNK2019: unresolved external symbol _D3DX11CreateEffectFromMemory@24 referenced in function "private: void __thiscall BoxApp::BuildFX(void)" (?BuildFX@BoxApp@@AAEXXZ)
1>C:\Users\Josh\Documents\Game Institute\DirectX\Chapter 1\Projects\Setup\Debug\Setup.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

我正在使用VS2012,并尝试使用Frank D Lunas DX11书中的示例程序来设置DX11。我不知道此错误消息意味着什么,将不胜感激。

I'm using VS2012 and trying to setup DX11 using a sample program from Frank D Lunas DX11 book. I have no idea what this error message means, any help would be appreciated.

1>------ Build started: Project: Setup, Configuration: Debug Win32 ------
1>Effects11d.lib(EffectAPI.obj) : error LNK2019: unresolved external symbol _D3DCompileFromFile@36 referenced in function _D3DX11CompileEffectFromFile
1>C:\Users\Josh\Documents\Game Institute\DirectX\Chapter 1\Projects\Setup\Debug\Setup.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


推荐答案

链接器找不到 D3DX11CreateEffectFromMemory 函数。此功能是 Effects11 框架的一部分。并且您需要链接 Effects11.lib 来构建此程序。

Linker cannot find definition of D3DX11CreateEffectFromMemory function. This function is a part of Effects11 framework. And you need to link Effects11.lib to build this program.

以前,要开发DirectX应用,您必须已 DirectX SDK 安装。
现在,独立的DirectX SDK与旧版有关,现在它是 Windows SDK (从8.0版开始)。安装Visual Studio 2012后,您已经掌握了它。

Previously, to develop DirectX apps, you must have been DirectX SDK installed. Now that stand-alone DirectX SDK concerned legacy and now it is a part of Windows SDK (since version 8.0). You`ve got it when installed Visual Studio 2012.

现在的问题是该SDK版本不包括Effect11框架。

The problem is now this SDK version doesn't include Effect11 framework, among other things.

有几种方法可以解决此问题:

There are several ways to fix this problems:


  1. 下载并安装旧版DirectX SDK。由于旧的DirectX SDK与新的Windows SDK冲突,因此在编译时会收到一些警告。要解决此问题,您可以将项目切换到 v110xp 工具集或安装 Windows 7 SDK ,然后在项目选项中切换到 v100

  2. 在此示例程序的情况下,Luna先生在源代码档案的 Common 文件夹中包含了已编译的库。但是我不确定它是否可以与Win8 SDK一起使用。

  3. 正确的源代码并删除Effect11的内容。如果您只是学习DirectX,这不是简单的方法。

  1. Download and install legacy DirectX SDK. When compiling you will get some warnings, because of conflicting old DirectX SDK and new Windows SDK. To solve this you can switch to your project to v110xp toolset or install Windows 7 SDK and switch to v100 in project's options.
  2. In case of this sample program, Mr. Luna included compiled libs in Common folder of source code archive. But I'm not sure if it will work with Win8 SDK.
  3. Correct source code and strip out Effect11 stuff. If you just learning DirectX, it is not easy way.

Chuck Walbourn-MSFT提供了更多解释:

Some more explanation from Chuck Walbourn - MSFT:

  • Where is the DirectX SDK?
  • Effects for Direct3D 11 Update

这篇关于DX11未解决的外部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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