By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,130 Members | 1,365 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,130 IT Pros & Developers. It's quick & easy.

Missing global variables from lib

P: n/a
Hi

I am using VC 6.0 on Win2k

I have multiple win32 static libs... each of the lib has global
variables and in the constructor of these variables i have
registeration code. This registeration code is a external function
whose implementation is in the dll..

But when I link and get the dll... these global variables seems to be
missing and the constructor code never gets executed.

Is the variables getting eliminated by the linker as it is not getting
directly used anywhere in the lib?

Is there a way I can avoid this and say export all symbols?

Regards
Rajesh

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Rajesh wrote:
I am using VC 6.0 on Win2k
Then you should *consider* posting to 'microsoft.public.vc.language'. Not
that we don't know the answers _specific_ to that compiler, it's just that
this is not a good place for them.

Also, you should *consider* upgrading your compiler. VC++ v6 is quite old
and its successor, v7.1 is much better in terms of standard compliance.
I have multiple win32 static libs... each of the lib has global
variables and in the constructor of these variables i have
registeration code. This registeration code is a external function
whose implementation is in the dll..

But when I link and get the dll... these global variables seems to be
missing and the constructor code never gets executed.
DLLs are compiler- and OS-specific. As such they are OT here.
Is the variables getting eliminated by the linker as it is not getting
directly used anywhere in the lib?
Impossible to tell in terms of the Standard C++ language. Linking is not
defined by the language specification.
Is there a way I can avoid this and say export all symbols?


Again, this is compiler- and OS-specific. You'll have to ask in a VC++
forum. Try 'microsoft.public.vc.language'.

V
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.