This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [MAC] 'static const std::string' in a header file


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]