如何修复 C++ Visual Studio 2022 中的链接错误?

问题描述 投票:0回答:0

我尝试使用 youtube 教程导入 DirectX 库,但出现 LNK1120 错误。

所以这是我复制的代码:

#include <Windows.h>
#pragma comment(lib, "d3d11.lib")
#pragma comment(lib, "DirectXTK.lib")

int APIENTRY wWinMain(
   _In_ HINSTANCE hInstance,
   _In_opt_ HINSTANCE hPrevInstance,
   _In_ LPWSTR IpCmdLine,
   _In_ int nComShow)
{
   return 0;
}

这些是我的错误: LNK1120 and LNK1119

我的项目设置就像视频中的一样(9:33 - 13:00): https://www.youtube.com/watch?v=gQIG77PfLgo

所以我运行了程序,它没有工作,但它还在其他位置创建了新的调试和发布文件夹。

在项目设置中,我将可执行目录更改为:

对于x64$(VC_ExecutablePath_x64);$(CommonExecutablePath)

对于Win32$(VC_ExecutablePath_x86);$(CommonExecutablePath)

但我认为这没有任何作用...

c++ visual-studio directx linker-errors
© www.soinside.com 2019 - 2024. All rights reserved.