I installed
codeblocks-13.12mingw-setup.exe on Windows 7. The following C++ code is giving a segmentation fault. Does anyone know why??
I'm using the GNU GCC compiler that came with the codeblocks installer. Error seems to be compiler related. Code runs fine if I enable any of the optimization flags (i.e. -O, -O1, -O2, etc.), but errors at the exp() call if none of the optimization flags is selected.
#include <iostream>
#include <complex>
using namespace std;
int main ()
{
complex<double> cc;
cc = exp(complex<double>(0.0,1.0));
return 0;
}