I'm writing a DLL to replace a much older one. The new version adds a new function, foo()
that is more useful than bar()
in the older DLL and effectively replaces it. However, I still need to have a usable bar()
for legacy support. What I want are both foo()
and bar()
to be externally accessible, so I've written a bar()
that calls the newer foo()
.
Header file:
extern "C" void* __stdcall foo();
extern "C" void* __stdcall bar();
DLL main file:
extern "C" void* foo() {}
extern "C" void* bar()
{
foo();
}
Upon attempting to build, though, Visual Studio gives me
error LNK2019: unresolved external symbol _bar@20 referenced in function _wmain
I suspect I'm having some kind of scope issue, since the only unique thing about bar() seems to be that it calls other functions in the main DLL.