I have 2 static libraries from «vendor1» and «vendor2»:
vendor1.lib
andvendor1.h
;vendor2.lib
andvendor2.h
.
In the file, vendor1.h
. The following declaration is there:
double Min();
In the file, vendor2.h
. The following declaration is there:
double Min();
In my client file:
include "vendor1.h"
include "vendor2.h"
double x = Min();
It by defaults calls vendor1.h
. I tried introducing the namespace:
namespace vendor1 {
include "vendor1.h"
}
namespace vendor2 {
include "vendor2.h"
}
A call to the following function
double xx = vendor2::Min();
I get the following linker errors:
Client.cpp 1>Client.obj : error LNK2019: unresolved external symbol "double __cdecl vendor2::Min(void)" (?Min@vendor2@@YANXZ) referenced in function _wmain 1>c:\temp\Client\Debug\Client.exe : fatal error LNK1120: 1 unresolved externals
How can I fix this without creating wrappers for each of the wrappers?