简体   繁体   English

未解决的外部符号错误,C ++ VS15 d3dx9库

[英]Unresolved External Symbol error, C++ VS15 d3dx9 Library

for some reason i've gotten a " unresolved external symbol " error and I just can't figure out why.. 由于某种原因,我收到了“无法解析的外部符号 ”错误,而我只是不知道为什么。

It complains about " __snprintf ", " __sprintf " and " __vsnprintf " even though I am not even using those.. 它抱怨“ __snprintf ”,“ __sprintf ”和“ __vsnprintf ”,即使我没有使用它们。

Picture of compiler: 编译器图片:

在此处输入图片说明

As you can see I am using d3dx9.lib and these are my includes & libraries: 如您所见,我正在使用d3dx9.lib,这些是我的include&库:

#include <Windows.h>
#include <iostream>
#include <stdio.h>

#include "d3d9.h"
#include "d3dx9.h"
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")

The only code I use printf in: 我在以下位置使用printf的唯一代码:

void v_DrawText(int X, int Y, D3DCOLOR Color, ID3DXFont *font, const char* sText, ...)
{
     char sText_[1024] = "";
     va_list ap;

     if (!sText || *sText == '\0')
        return;

     va_start(ap, sText);
     _snprintf_s(sText_, 1024, 1023, sText, ap);
     va_end(ap);

     RECT Position = { X, Y, X + 500, Y + 50 };
     font->DrawText(NULL, sText_, -1, &Position, DT_LEFT | DT_WORDBREAK, Color);
}

I have already tried rebuilding the solution from ground, redownloading the library, adding it to the linker directly.. but no. 我已经尝试过从头开始重建解决方案,重新下载库,然后将其直接添加到链接器中。 Just won't work.. 只是行不通..

Project Configuration (as requested): 项目配置(根据要求):

在此处输入图片说明

Keep in mind that D3DX9 (and D3DX10 , D3DX11 ) and the DirectX SDK are all deprecated. 请记住, D3DX9 (和D3DX10D3DX11 )和DirectX SDK均已弃用。 See MSDN . 参见MSDN VS 2010 was the last version officially supported by D3DX9 with the DirectX SDK (June 2010). VS 2010是D3DX9与DirectX SDK正式支持的最新版本(2010年6月)。 In general import libraries should work, but static libraries are quite likely not to work. 通常,导入库应该起作用,但是静态库很可能不起作用。

Note that DXERR.LIB does not work with VS 2015 because the CRT has changed. 请注意,DXERR.LIB不适用于VS 2015,因为CRT已更改。 See this thread for details. 有关详细信息,请参见此线程

You are still using DirectX SDK 9.0b from Summer 2004 which at the time supported VS .NET 2002 and VS .NET 2003. If you still need to use legacy D3DX9, move to the DirectX SDK (June 2010) release. 您仍在使用2004年夏季开始的DirectX SDK 9.0b,该版本当时支持VS .NET 2002和VS .NET2003。如果仍然需要使用旧版D3DX9,请移至DirectX SDK(2010年6月)发行版。 See this post . 看到这篇文章

Also, you have the include/lib paths incorrectly configured for mixing the legacy DirectX SDK with the Windows 8.x SDK that comes with VS 2012 or later. 另外,您还错误地配置了包含/库路径,以将旧版DirectX SDK与VS 2012或更高版本随附的Windows 8.x SDK混合使用。 See the instructions on MSDN for the proper path order which is the reverse of what you have currently. 有关正确的路径顺序,请参阅MSDN上的说明,这与当前的顺序相反

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

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