Thanks, Tim, and congrats :icon_mrgreen:
So are these your linker options?
gcc quadmath.c -o quadmath
-Wl,-Bstatic -lquadmathMy results:
C:\TDM-GCC-32\bin\gcc.exe -Wl,-Bstatic -lquadmath -o tmp.exe "Tmp.cpp"
C:\Users\Jochen\AppData\Local\Temp\cceeec7X.o:Tmp.cpp:(.text+0x29): undefined reference to `strtoflt128'
C:\Users\Jochen\AppData\Local\Temp\cceeec7X.o:Tmp.cpp:(.text+0xc9): undefined reference to `quadmath_snprintf'
C:/TDM-GCC-32/bin/../lib/gcc/mingw32/4.9.2/../../../../mingw32/bin/ld.exe: C:\Users\Jochen\AppData\Local\Temp\cceeec7X.o: bad reloc address 0x7 in section `.text$getchar[_getchar]'
C:/TDM-GCC-32/bin/../lib/gcc/mingw32/4.9.2/../../../../mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
If I remove the comma (-Wl -Bstatic), it tells me unrecognized command line option '-Wl', so I assume the comma has a meaning.
My installation is less than three years old. Most of the time C/C++ code compiles and runs fine, but this one gives me the creeps :(
C:\MinGW\mingw32\lib\gcc\mingw32\4.8.1\libquadmath.a 570236 bytes, 5.10.2013
C:\MinGW\mingw32\lib\gcc\mingw32\4.8.1\include\quadmath.h 9030 bytes, 5.10.2013
P.S.: I love passing hours and hours on the Internet watching how others despair :t
But in the end, own trial and error may advance humanity more quickly

#include <stdio.h>
#include <quadmath.h>
// gcc ./quadmath.c -o quadmath -lquadmath
// gcc quadmath.c -o quadmath
// OxPT_Linker -Wl,-Bstatic -lquadmath
// OxPT_Linker -Wl,-Bdynamic -lquadmath
// OxPT_Linker -Wl,-Bstatic "C:\MinGW\mingw32\lib\gcc\mingw32\4.8.1\libquadmath.a"
// OxPT_Linker -Wl,-Bdynamic C:\TDM-GCC-32\bin\libquadmath-0.dll
// OPT_Linker C:\TDM-GCC-32\bin\libquadmath-0.dll ; HEY, THIS ONE WORKS!!!!
int main ()
{
__float128 r;
char buf[128];
for (int i=0;i<128;i++) buf[i]=0;
// __asm("int $3");
r = strtoflt128("1.2345678", NULL); // undefined reference to `strtoflt128'
// __asm("nop");
// r = 123.456; // OK
quadmath_snprintf (buf, sizeof buf, "%Qa", r);
quadmath_snprintf (buf, sizeof buf, "%Qf\n", r);
printf("Buffer: [%s]", buf);
getchar();
return 0;
}
Output: Buffer: [0x1.3c0ca2a5b1d5d0818d3359c99ff2p+0]
Not yet the expected result, but since I've seen some similar results in desperate posts on the web (e.g.
That code produced -3.8518598887744717061119558851698546e-34 error on my box), it can only be a question of weeks until I find the magic trick :icon_mrgreen: