S
seaders69
I'm developing a large enough application which is using quite a few
custom libraries, but I'm running into a few strange errors, and
crashes, at runtime.
I've got quite a few class structures in place and am also reading in
configuration input from a file. So, in one particular class, I've
two maps, one an <int, int> template, the other <char, int> and it
also contains a vector <int>, all of them are static, which they need
to be, for the purpose of the application.
Now, if I compile my code and run it, with nothing in the main block,
just
/** all relevant files included */
int main() {
return 0;
}
it crashes at the return 0. Now, after some investigation, I found
out that if I commented out where the map <char, int> was being
initialised, in it's cpp file, the application would run fine.
I'm using MinGW, with the Eclipse CDT IDE and remember running into
some problem like this before, but remember if / how I got around it.
Also, if I turn on optimisation, either at the 2, or 3 level, the
program works fine then, too. I assume that it's a memory allocation
issue, or similar, but I really am stumped. I don't even know what I
should be googling / reading up on, to figure out what's wrong.
Thanks for any help.
custom libraries, but I'm running into a few strange errors, and
crashes, at runtime.
I've got quite a few class structures in place and am also reading in
configuration input from a file. So, in one particular class, I've
two maps, one an <int, int> template, the other <char, int> and it
also contains a vector <int>, all of them are static, which they need
to be, for the purpose of the application.
Now, if I compile my code and run it, with nothing in the main block,
just
/** all relevant files included */
int main() {
return 0;
}
it crashes at the return 0. Now, after some investigation, I found
out that if I commented out where the map <char, int> was being
initialised, in it's cpp file, the application would run fine.
I'm using MinGW, with the Eclipse CDT IDE and remember running into
some problem like this before, but remember if / how I got around it.
Also, if I turn on optimisation, either at the 2, or 3 level, the
program works fine then, too. I assume that it's a memory allocation
issue, or similar, but I really am stumped. I don't even know what I
should be googling / reading up on, to figure out what's wrong.
Thanks for any help.