help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

non-local static object initialization problems


From: Ali
Subject: non-local static object initialization problems
Date: Wed, 11 Jul 2007 20:09:37 -0000
User-agent: G2/1.0

My problem is quite similar to Item 10 of Effective C++ (Scott
Meyers):

http://www.awprofessional.com/content/downloads/meyerscddemo/DEMO/EC/EI10_FR.HTM

I have Airplane objects declared in a namespace myNamespace in a file
main.cpp, the memPool is initialized correctly. Everything works fine
on Win32 platform with MinGW GCC 3.4.4, Borland C++ Builder 6, Visual
Studio 2003 and Visual Studio 2005.

On Linux with GCC 3.3.5 and Intel C++ Compiler 8.1 i get segmentation
fault, i could debug the reason: memPool is not yet initialized when
the constructor is called for the Airplane objects in myNamespace.

Could anyone explain why?

Many thanks in advance,

Ali



reply via email to

[Prev in Thread] Current Thread [Next in Thread]