I have a C++ project in Visual Studio where libs (oldVersion.lib, newVersion.lib) are added via project properties -> Linker -> Input -> Additional Dependencies.
Both libs contain the same function (e.g. foo()
). The functions are included by their header files and called via ::foo()
.
The code itself does not show an error but at runtime it is not clear if foo()
from oldVersion or newVersion is executed.
Is it possible to differentiate between same named functions from the two different .libs? (Like aliases
in C#)
What I tried:
Wrapping external libraries in namespaces
Not working because in linecoollib_coolthing(howcool);
it is not clear wherehowcool
(which would befoo
) comes from.-
namespace newVersion{ #inlcude "newVersion.h" }
Here, the
newVersion
namespace is added to the information from the .h file butnewVersion::foo()
still executes the firstfoo
it can find somewhere.