DirectX 11 中未解析的外部符号'_D3DX10CreateFontIndirectA@12'
Unresolved external symbol '_D3DX10CreateFontIndirectA@12' in DirectX 11
我当前正在尝试编写一些代码以使用DirectX 11显示一些文本,但是在构建它时,我收到了以下错误:
1>Source.obj : error LNK2019: unresolved external symbol _D3DX10CreateFontIndirectA@12 referenced in function "bool __cdecl InitScene(void)" (?InitScene@@YA_NXZ)
和参考,这是我拥有的代码,包括我认为可能引起问题的行:
bool InitScene()
{
D3DX10_FONT_DESC fd;
fd.Height = 175;
fd.Width = 0;
fd.Weight = 0;
fd.MipLevels = 1;
fd.Italic = false;
fd.CharSet = OUT_DEFAULT_PRECIS;
fd.Quality = DEFAULT_QUALITY;
fd.PitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
strcpy_s(fd.FaceName, "Impact"); //Need to find out how to fix this.
D3DX10CreateFontIndirect(d3dDevice, &fd, &Font);
return true;
}
有人知道为什么会发生这种情况吗?
您需要与d3dx10.lib。
链接假设您正在使用Visual Studio,请右键单击您的项目并打开属性。在左侧,扩展并选择配置属性 -> linker->输入。然后在正确的部分中,在"添加依赖关系"中,将库名称添加为d3dx10.lib使用Semicolon将其与任何其他列出的库分开。
确保在构建过程中实际使用了这些"其他依赖",应验证另外两件事。在配置属性下 ->链接 ->一般1)确保为"链接库依赖关系"选择"是"。2)确保为"使用库依赖项输入"选择"是"。
将来,对于任何显示"未解决的外部符号"的错误,请找出上述未解决函数/符号属于哪个库,并在上面提到的"其他依赖关系"中添加该库。
此功能D3DX10CreateFontirect需要链接d3dx10.lib。顺便说一句,如果您想在DX11中渲染字体,建议您使用DirectWrite,这是在DirectX中渲染字体的新技术。
d3dx10 createfontirect
directwrite
相关文章:
- 在C++中,将大的无符号浮点数四舍五入为整数的最佳方法是什么
- 有符号的int和int-有没有一种方法可以在C++中区分它们
- 将无符号char*转换为std::istream*C++
- 如何在C++中将一个无符号的 int 转换为两个无符号的短裤?
- vscode g++链路故障:体系结构x86_64的未定义符号
- 从矢量<无符号字符>转换为字符* 包括垃圾数据
- 如何理解将半精度指针转换为无符号长指针和相关的内存对齐
- Visual studio代码重构似乎不起作用(例如,重命名符号-f2)
- 使用gcc从静态链接的文件中查找可选符号
- C++中无符号字符溢出
- 使用无符号字符数组有效存储内存
- C++:Application.cpp中抛出了未解析的外部符号(解决方案在问题的末尾,供未来的读者参考)
- VC++本机单元测试,找不到调试符号
- 为什么我必须在C++中添加一个赋值符号来声明一个数组
- 检查TCHAR数组输入是否为带符号整数C++
- 用符号版本替换对函数的所有调用
- 未解析的外部符号_MsiLocateComponentW@12.
- 如何打印boost多精度128位无符号整数
- C++模板函数,用于比较任何无符号整数和有符号整数
- 在 Mac 上使用 CMAKE 将 FFTW 和 FFTWPP 链接到项目中时未定义的符号