Jump to content
  • Advertisement
Sign in to follow this  

static member functions - statics removed still doesn't initialize (HELP PLEASE!!!)

This topic is 4679 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all I have a MAJOR problem. My app is trashing the stack before it is initialized, therfore it can never start as the stack is oblitrated. I've been told that this can be caused by large global/static variables. Is this also true with static member functions? Ther code I've got is based on the Enginuity engine and some of the classes have lots of static member functions. Would it be sensible to replace these with public member functions. I know that I'd have to then use them through an instansiated objected of the class, but might this be the cause of my stack issues? [Edited by - garyfletcher on July 29, 2005 4:49:49 PM]

Share this post


Link to post
Share on other sites
Advertisement
Right.

I believe that is some other statics I have.

I'm just going through now and refactoring to member vars.

One question though. If I have a var declared:

static boost::shared_ptr<aClass> aName;

Coudl this cause the major stack issues I've been seeing. I must admit my knowledge of the stack is pretty limited.

Share this post


Link to post
Share on other sites
Okay...this is not funny anymore!!

I've got rid of ALL statics...variables, functions EVERYTHING!!!

And my app is still not initializing. Can ANYONE give me any lead on what to look for.

Application Error Pop-up states:

The application failed to initialize properly (0x0000005). Click on OK to terminate the application.

In the debugger I get:

Selecting target: default
Compiling: done
Starting debugger: done
Adding source dir: C:\cvshome\SiSE\NewEngineCB\devAdding file: enginedev.exe
Changing directory to: C:/cvshome/SiSE/NEWENG~3/dev
Program received signal (SIGSEGV)
Segmentation fault
error
Error: dll starting at 0x3d1000 not found.
Program received signal (SIGSEGV)
Segmentation fault
Program received signal (SIGSEGV)
Segmentation fault
exited -1073741819
error
Debugger finished with status 0

I'm using the latest of code::blocks (RC1) with XP.

Please help.


Share this post


Link to post
Share on other sites
I'm confused.... can't you just run your app in the debugger and *see* where it's failing? main is NOT the first function that runs.

Share this post


Link to post
Share on other sites
You don't need to put a breakpoint. When a segfault occurs, the compiler will dump you wherever the segfault happened.

main() is the entrypoint, but other things happen before main(), such as constructors of global objects.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!