如何解决“无法解析的外部符号”问题DirectX 11 程序中出现错误?
我正在为学校开发一个 DirectX 11 项目,并且在执行此操作时我完全遵循了本书的内容。我一直在想,也许有些东西被标记为错误的,但我仔细检查了我的所有文件,我所有的类名都很好(我相信它们很好),并仔细检查了我所有头文件的设置方式,一切都应该没问题,我仍然得到这个错误输出:
1>BlankDemo.obj : error LNK2019: unresolved external symbol "public: __thiscall DemoBase::DemoBase(void)" (??0DemoBase@@QAE@XZ) referenced in function "public: __thiscall BlankDemo::BlankDemo(void)" (??0BlankDemo@@QAE@XZ) 1>BlankDemo.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall DemoBase::~DemoBase(void)" (??1DemoBase@@UAE@XZ) referenced in function "public: virtual __thiscall BlankDemo::~BlankDemo(void)" (??1BlankDemo@@UAE@XZ) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall DemoBase::Shutdown(void)" (?Shutdown@DemoBase@@QAEXXZ) referenced in function _wWinMain@16 1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall DemoBase::Initialize(struct HINSTANCE__ *,struct HWND__ *)" (?Initialize@DemoBase@@QAE_NPAUHINSTANCE__@@PAUHWND__@@@Z) referenced in function _wWinMain@16 1>C:\Users\vaughn\documents\visual studio 2010\Projects\BlankWindow\Debug\BlankWindow.exe : fatal error LNK1120: 4 unresolved externals
我该如何解决这个问题?
I am working on a DirectX 11 project for school and I followed the book thoroughly when doing this. I keep thinking that maybe something is labeled wrong but I double checked all my files, all my class names are fine (I believe they are fine) and double checked how all my header files are setup and everything should be okay and I still get this error output:
1>BlankDemo.obj : error LNK2019: unresolved external symbol "public: __thiscall DemoBase::DemoBase(void)" (??0DemoBase@@QAE@XZ) referenced in function "public: __thiscall BlankDemo::BlankDemo(void)" (??0BlankDemo@@QAE@XZ) 1>BlankDemo.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall DemoBase::~DemoBase(void)" (??1DemoBase@@UAE@XZ) referenced in function "public: virtual __thiscall BlankDemo::~BlankDemo(void)" (??1BlankDemo@@UAE@XZ) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall DemoBase::Shutdown(void)" (?Shutdown@DemoBase@@QAEXXZ) referenced in function _wWinMain@16 1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall DemoBase::Initialize(struct HINSTANCE__ *,struct HWND__ *)" (?Initialize@DemoBase@@QAE_NPAUHINSTANCE__@@PAUHWND__@@@Z) referenced in function _wWinMain@16 1>C:\Users\vaughn\documents\visual studio 2010\Projects\BlankWindow\Debug\BlankWindow.exe : fatal error LNK1120: 4 unresolved externals
How do I solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然,您要么没有实现 DemoBase 类中的一些方法(包括其构造函数和析构函数),要么没有将实现文件包含在要编译或链接的文件列表中你的程序。实现它们,然后确保您已将源文件包含在项目中。
Evidently, you either haven't implemented a handful of methods from the
DemoBase
class (including its constructor and destructor), or you haven't included the implementation file in the list of files to compile or link with your program. Implement them, and then make sure you've included the source file in your project.