Monday 12 June 2017

c++ - How do I solve "unresolved external symbol" errors in a DirectX 11 program?



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?


Answer



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.


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...