I have a question for anyone who is willing to help me out in my time of
utter confusion.

I am doing a proof of concept (ergo little time for design, and therefor
not very well structured) for a project and am having problems with
certain global variables.

In the main application header file I create global variables for each
of the databases to be used by the application.  I use the:

#ifndef <identifier>
#define <identifier>
#endif

group in order to include the contents of my header files only once
regardless as to how often it is included by other files.  I must,
however, for some reason declare my globals as static since if I don't I
get multiple definition errors.

Now, I have 3 different files accessing these globals.  Two of them work
fine, one does not.  When I get to that file the database variable being
used seems to have been reset and so I get a rather nasty error when I
try to access it with the DmNumRecords function.

I really don't understand why the linker thinks there are multiple
declarations of these variables if not set static, and I do not
understand why two of the files would work and one would not.  They all
have the proper headers included...

Any help would be greatly appreciated!

Sam Charette


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to