This really beats me and the Visual Studio 2008 is so brainless that it's not helpful with the following errors at all.
My C++ solution has several projects in it. One project has the base C++ class CCrashReporter in crashreporter.h and crashreporter.cpp files.
I need to derive another class from it that is located in another project in the same solution. So I do:
//From CrashReporter2.h
#pragma once
#include "..\BaseModules\CrashReporter.h"
class CCrashReporter2 :
public CCrashReporter
{
public:
CCrashReporter2(void);
virtual ~CCrashReporter2(void);
};
and then:
//From crashreporter2.cpp
#include "StdAfx.h"
#include "CrashReporter2.h"
CCrashReporter2::CCrashReporter2(void):
CCrashReporter(ENTERY_PARAM_FOR_REPORTER2)
{
}
CCrashReporter2::~CCrashReporter2(void)
{
}
The above code compiled OK, but when the linker runs I get these:
1>CrashReporter2.obj : error LNK2019: unresolved external symbol "public: __thiscall CCrashReporter::CCrashReporter(int) blah-blah
1>CrashReporter2.obj : error LNK2019: unresolved external symbol "public: __thiscall CCrashReporter::~CCrashReporter(void) blah-blah
1>C:\Users\Dev\C++\ProjName123\Debug\Mod123.exe : fatal error LNK1120: 2 unresolved externals