Zelengora, Bosnia and Herzegovina

How to increase stack size in c++ (IDE : codeblocks)?

In windows use --slack specific flag.

For codeblocks follow:

  • go to settings -> compiler
  • go to linker settings tab and add “-Wl,–stack,SIZE” in the other linker options section (i have set 512mb)

On Linux, to get an unlimited stack, you should open a shell and run this command:

$ ulimit -s unlimited

And then (until you close that shell) the stack limit for that shell (and for the commands you will call from inside that shell) will be unlimited.