Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Global and Static Variable initialisation Problem on MAC-OSX 10.3.3 & GCC 3.3 ........



Gaurav,

Generally getting global and static variables to work correctly is relatively straight forward. Can you post some code snippets showing the general organization of the classes and object you are having trouble with, and perhaps someone on the list can help.

The only things that I can think of that could cause the problems your seeing are, either a misunderstanding of how global and static variables work. Or, you in your code you have one or more global or static variables that depend on other global/static variables being initialized. Some compilers allow you to control the order that globals and statics are initialized, I don't know if gcc is one of those compilers. Typically, the safest route is to write your code in such a way that the order that global and statics are initialized isn't important.

Anyway, you can probably get some more specific help if you provide a few more details.

On 6-Feb-06, at 5:58 AM, Gaurav Kumar wrote:

hi all

I am using GCC 3.3 for compiling my process on MAC-OS X 10.3.3.

I am constructing a global static variable i.e object of a class in
another class file. I have included that class header. The error is
Abort Trap after the object construction. Anywhere in my project if i
make global object of that class, the execution don't go beyond that.

That class object depends upon some other global variables. If we
explicitly initialize those variables then also it throws error.

The global variable calls its constructor properly.

But the pointer of the global variable works when we initialize it in
main i.e Local pointer.

Can you suggest what is real problem in initializing global variable or
the in which i should proceed to solve the bug.
if you require any more information do mail me.


Thanks
Gaurav

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/cliff_russell% 40atimi.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >Global and Static Variable initialisation Problem on MAC-OSX 10.3.3 & GCC 3.3 ........ (From: Gaurav Kumar <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.