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

Started by
10 comments, last by garyfletcher 18 years, 8 months ago
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]
Gary.Goodbye, and thanks for all the fish.
Advertisement
No. Static member functions would not cause problems like that.
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.
Gary.Goodbye, and thanks for all the fish.
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.


Gary.Goodbye, and thanks for all the fish.
Try compiling Hello World. If it doesn't work, re-install your compiler and/or get a new one.
-----http://alopex.liLet's Program: http://youtube.com/user/icefox192
Hello World works fine...boo hoo!!!!

This is a bit of a 'mare!!

Guess it's back to the drawing board!!!!
Gary.Goodbye, and thanks for all the fish.
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.
It isn't?

I'm confused then. I though that main() was the entry point....where else could I put a breakpoint?
Gary.Goodbye, and thanks for all the fish.
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.
Right.

It seems to be failng in SDL_Main.

Thanks for the advise...will have to just see what I can see..:)
Gary.Goodbye, and thanks for all the fish.

This topic is closed to new replies.

Advertisement