global variables and class statics in a static library

R

rsforster

Does anyone know where I can get info on the rules for creating static
libraries in C++ (I am using Visual Studio 6.0)? Or can anyone answer
the following questions:

1. I have globals that are coming up as unresolved in the library test
application:

aule_timer * system_timer;
aule_keyboard * keyboard;

(I seem to have fixed this by specifying them in my main module in the
test app (instead of in the library module where I originally put them
- but an explanation of the rules for this kind of thing would be
useful)

2. I have two static class variables that are also coming up as
unresolved:

class aule_window_manager {
protected:

static aule_window_manager * application_window_manager;
static std::map<char *, aule_window_manager *> identifier_map; <-
this one
static std::map<HWND, aule_window_manager *> handle_map; <- and
this one

.... etc

Robin.
 
R

rsforster

Looks like spaghetti on the screen. I was refering to the two maps.
Both are static class variables.
 
T

Thomas Matthews

Does anyone know where I can get info on the rules for creating static
libraries in C++ (I am using Visual Studio 6.0)?
Library implementations are outside the domain of the language and
this newsgroup. Try a newsgroup that discusses your compiler (see
my signature below).

Or can anyone answer the following questions:

1. I have globals that are coming up as unresolved in the library test
application:

aule_timer * system_timer;
aule_keyboard * keyboard;

(I seem to have fixed this by specifying them in my main module in the
test app (instead of in the library module where I originally put them
- but an explanation of the rules for this kind of thing would be
useful)
Symbols are usually resolved in the latter phases of translation.
Commonly, this is in the linking phase. Perhaps you need to specify
a library or are specifying it incorrectly (e.g. in the wrong order).
Some tools will only parse a library once so the library must be
either later in the list or repeated in the list.

2. I have two static class variables that are also coming up as
unresolved:

class aule_window_manager {
protected:

static aule_window_manager * application_window_manager;
static std::map<char *, aule_window_manager *> identifier_map; <-
this one
static std::map<HWND, aule_window_manager *> handle_map; <- and
this one
Looks like the symbol "aule_window_manager" or "HWND" are not linked
in. Is there _code_ linked in for the symbols and not just the
{class} definitions?



--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top