8
c:\...random.h|106|error: expected unqualified-id before '__int128'

When I'm compiling a 32 bit program, the above is the error I get. I'm using http://sourceforge.net/projects/mingwbuilds/

Why? My code compiled fine with 4.7.2 but I wanted to update to 4.8 for the bug fixes and it gets rid of the 0 used as null value for pointer warnings when there are no zeros.

Many of the bug fixes I want. It compiles my x64 ones just fine on Windows.

Is there a way to get it to compile x32 applications?

4

1 回答 1

7

__int128 is protected by

!defined(STRICT_ANSI) && defined(_GLIBCXX_USE_INT128)

So, you could either use -ansi (in case your code is strictly ansi c++ complaint), I faced errors in linker due to the fact that the linker unable to find the 32bit libs.

_GLIBCXX_USE_INT128

is defined in "lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++/x86_64-w64-mingw32/bits/c++config.h" which I am pretty sure was generated by the autoconfigure based on the system the tool chains are built.

You better download the 32bit version on mingw gcc (binary) package and install them too.

于 2014-01-10T00:31:04.880 回答