Hi Everyone,
I found a thread on that topic posted year 2004 but not satisfied with
the information there. So I decided to raise that issue once again.
In general the problem with VS.NET 2003 linker is that it will discard
an object file containing definitions of global variables of any type/
class if nothing else in this file is referenced by other files in the
project.
Now I have the following case. In given source file I have definitions
of several global variables that in contructor register itself in
another global container object. Later in code any of these variables
would be accessed via that global container. But what actually happens
is that the linker decides to discard the object files and instances
of these global variables are never created and registered in the
container.
I am not sure what should be the correct behaviour of the linker in
that case but could anyone let me know how to overcome that problem
and make the linker to include the needed object files without forcing
it to include any object files from given library even if not
referenced at all?
Can we say that in my case objects are not referenced at all since
even if they are not referenced directly still it is possible to be
reference via the container object?
Many thanks in advance!
Best regards,
Boris.