简体   繁体   中英

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..

Picture of compiler:

在此处输入图片说明

As you can see I am using d3dx9.lib and these are my includes & libraries:

#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:

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. See MSDN . VS 2010 was the last version officially supported by D3DX9 with the DirectX SDK (June 2010). 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. 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. 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. See the instructions on MSDN for the proper path order which is the reverse of what you have currently.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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