TF
2003-11-26 20:01:47 UTC
Hi,
I have a very basic question. I have defined few constants (const char
*) in a header file (unix C) that i want to use in some library files
as well as a main (executable) file (this file also uses that library
functions). While linking compiler gives "duplicate symbols" error.
Now I know the reason but can any one tell me how can i avoid this
proplem? Also I don't want to use 'extern' in every file for those
constants.
Thanks
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
I have a very basic question. I have defined few constants (const char
*) in a header file (unix C) that i want to use in some library files
as well as a main (executable) file (this file also uses that library
functions). While linking compiler gives "duplicate symbols" error.
Now I know the reason but can any one tell me how can i avoid this
proplem? Also I don't want to use 'extern' in every file for those
constants.
Thanks
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]