Hi all,
I have code like this:
bool doSomething()
{
std::cout << "I'm here!"
return true;
}
const bool x = doSomething();
If placed in a cpp-file in my Visual C++ console application, the code is executed as expected before entering the main() method.
However, if I place this code in a .cpp-file inside a static link library project (which is linked to my console application), the code is never executed. I do not define any methods in this file that are used from outside, there is no according .h-file. So is it possible that the linker doesn't link the file? How can I avoid this?
(Actually the code gets executed if I create a header file for the cpp file, place another method "void dummy() {}" inside the cpp- and h-file and call dummy() from main.)
Thanks a lot!