CreateDXGIFactory 函数抛出链接器错误

Ash*_*nni 1 visual-c++ dxgi

我正在尝试对 DXGI API 进行实验,并且正在创建一个控制台应用程序,该应用程序从工厂对象中枚举可用的适配器。

代码片段如下所示:

// pFactory and vecAdapters are initialized as static variables

// Snippet from a static function 
HRESULT result = CreateDXGIFactory(__uuidof(IDXGIFactory), (void**)&pFactory);
if (result == S_OK) {
    UINT i = 0;
    IDXGIAdapter* pAdapter;
    while (pFactory->EnumAdapters(i, &pAdapter) != DXGI_ERROR_NOT_FOUND) {
        vecAdapters.push_back(pAdapter);
        ++i;
    }
}
Run Code Online (Sandbox Code Playgroud)

但我收到链接器错误,如下所示:

error LNK2019: unresolved external symbol _CreateDXGIFactory@8
Run Code Online (Sandbox Code Playgroud)

我使用的标题如下:

#include <Windows.h>
#include <dxgi.h>
#include <dxgi1_2.h>
#include <vector>
Run Code Online (Sandbox Code Playgroud)

我错过了什么吗?

提前非常感谢您对我的帮助!