compiling following code with g++ leads to a crash while executing the sqrt function. Compiled fine with the older gcc versions.
#include<complex>
int main()
{
std::complex<double> x(1., 0.);
std::sqrt(x);
return 0;
}
$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.7.0/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.7.0/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++
--disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-r
egistry --enable-libstdcxx-debug --disable-build-poststage1-with-cxx --enable-version-spec
ific-runtime-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.7.0 (GCC)
$ ld -v
GNU ld (GNU Binutils) 2.22
Are all your libraries compiled with 4.7.0, including the mingw runtime and w32api?
I did not compile any libraries.by my own. This are the steps two reproduce the error:
1. install mingw
use pre-packaged repository catalogues
2.
> g++ -v
gcc version 4.6.2
> g++ sqrt_test.c
> ./a.exe
-> works
3.
> mingw-get update
> mingw-get upgrade
4.
> g++ -v
gcc version 4.7.0
> g++ sqrt_test.c
> ./a.exe
-> crash