7

Does anyone know what this means?

1>  Generating Code...
1>BlankWindowDXbaseImpl.obj : error LNK2019: unresolved external symbol "public: __thiscall DXBase::DXBase(void)" (??0DXBase@@QAE@XZ) referenced in function "public: __thiscall BlankWindowDXBaseImpl::BlankWindowDXBaseImpl(void)" (??0BlankWindowDXBaseImpl@@QAE@XZ)
1>BlankWindowDXbaseImpl.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall DXBase::~DXBase(void)" (??1DXBase@@UAE@XZ) referenced in function "public: virtual __thiscall BlankWindowDXBaseImpl::~BlankWindowDXBaseImpl(void)" (??1BlankWindowDXBaseImpl@@UAE@XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall DXBase::shutdown(void)" (?shutdown@DXBase@@QAEXXZ) referenced in function _wWinMain@16
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall DXBase::initalize(struct HINSTANCE__ *,struct HWND__ *)" (?initalize@DXBase@@QAE_NPAUHINSTANCE__@@PAUHWND__@@@Z) referenced in function _wWinMain@16
1>C:\backup\development\directXworkspace\BlankWindow\Debug\BlankWindow.exe : fatal error LNK1120: 4 unresolved externals
Sublimemm
  • 2,374
  • 3
  • 17
  • 14

6 Answers6

15

It means that you have unresolved external symbols.

What are symbols? Symbols can be anything from variables, classes, member functions or functions.

Why they are unresolved? Some part of your code (or libraries that you are using) rely on these symbols and they are not being found because you are not linking the correct library or implementing them.

Vinicius Kamakura
  • 7,665
  • 1
  • 29
  • 43
  • 1
    You are right of course, the linker can't find the right lib. However, in VS2010 I set the lib path to include the path to the required lib. It just simply wouldn't find it. I just got fed up and moved the class and header into the same project, so it's finding the lib locally. – Sublimemm Aug 10 '11 at 00:32
  • 2
    Obviously you're not doing it right, as this is a normal thing to do. At the risk of being patronising you need to 1) add the library directory to the 'General/Additional Library Directories' 2) add the library itself to the 'Input/Additional Dependencies' 3) don't forget the .lib when referencing the library in step 2. – john Aug 10 '11 at 04:51
4

Yes, it means your program calls functions that are declared but have no body.

Are you expecting these functions to be part of your code, or provided by some library?

Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
1

It means you have a linker problem. (The linker can't find a library with those symbols) You need to include the required library in your library path.

ccozad
  • 1,119
  • 8
  • 13
0

I just had the same issue and if you add the #pragma comment(lib,"d3d9.lib") This will include the library files necessary to compile your code. It is just getting confused which lib file to grab either the 64 or 32 bit. Hope this helps.

0

I'm sharing a just faced issue that was difficult to detect: if you are linking to two libs (a.lib and b.lib) located in different lib paths ( /PathToA/ and /PathToB/ ), the problem of unresolved externals may arise if there is an old version of, let's say b.lib in the path /PathToA/.

In this case, you may incorrectly link to an unwanted lib. So as a solution for this particular multi-linking problem, be sure that you do not have several versions of a library in your library paths.

Malick
  • 6,252
  • 2
  • 46
  • 59
0

probably you are not linking against proper library.

But you should give some more details.. it looks like you are asking question in a quiz contest.

A. K.
  • 34,395
  • 15
  • 52
  • 89