Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

__int128 error when compiling 32 bit

Tags:

c++

c

gcc

gcc4.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?

like image 963
Brandon Avatar asked Mar 31 '13 00:03

Brandon


1 Answers

__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.

like image 96
Sundar Avatar answered Sep 28 '22 12:09

Sundar