Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 11th, 2007, 09:05 PM
Ali
Guest
 
Posts: n/a
Default non-local static object initialization problems

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

http://www.awprofessional.com/conten...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 find 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

  #2  
Old July 11th, 2007, 11:16 PM
red floyd
Guest
 
Posts: n/a
Default Re: non-local static object initialization problems

Ali wrote:
Quote:
[redacted]
Oh, and please don't multi-post (that is, post the same question to
multiple newsgroups separately). This has been multi-posted to
comp.lang.c++, comp.lang.c++.moderated, and gnu.g++.help, at the very least.

If you're going to post to multiple newsgroups then cross-post (specify
multiple newsgroups when submitting), after first making sure it's
topical on all listed groups.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles