Set stack size with GCC 4.6.2 C ++ Qt, MinGW, Vista

I want to increase the stack size in my program, because I have a complex recursive algorithm, and it would be a real pain to overwrite iteratively.

I am using GCC C ++ 4.6.2. MinGw, creating the Qt.pro file (I use Qt for the GUI), on Vista.

The advice on this website should use: -

gcc -Wl,--stack,4194304 

and send this to the g ++ link phase with: -

 LIB += -Wl,--stack,4194304 

but linker errors with: -

g ++: error: unrecognized option '--stack, 4194304'

I tried sending parameters to the compilation stage using QMAKE_CXXFLAGS + =, but g ++ is still barfs.

The only option that is not barf is -fno-stack-limit from the GCC documentation (.pdf 4.5.0, p .260), but my stack is still full. Other options mentioned in this paragraph. puke.

+4
source share
2 answers

You need to add QMAKE_CXXFLAGS += -Wl,--stack,4194304 to your .pro file.

+2
source

Try the following:

 ulimit -s STACK_SIZE 
0
source

Source: https://habr.com/ru/post/1442650/


All Articles