This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [MAC] 'static const std::string' in a header file
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Mathieu Malaterre <mmalater at nycap dot rr dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 09 Jan 2005 01:35:45 +0100
- Subject: Re: [MAC] 'static const std::string' in a header file
- Organization: Integrable Solutions
- References: <41E06FE9.4030601@nycap.rr.com> <41E076C5.6050705@nycap.rr.com>
Mathieu Malaterre <mmalater@nycap.rr.com> writes:
| Solution:
|
| I moved:
|
| const std::string foo = "bar";
|
| in a random cxx file, and defined instead:
|
| extern const std::string foo;
|
| in the header file. Everything seems to be working fine now.
make sure that global object gets properly initialized before its
first use. See classic books on c++ software.
-- Gaby