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?

14
  • 1
    Short answer is no. __int128 is meant for 64-bit systems. Commented Mar 31, 2013 at 0:48
  • 3
    Oh... sounds like your installation is borked then. Commented Mar 31, 2013 at 0:50
  • 1
    Then you'll probably need to edit G++'s headers to guard against using 128-bits on 32-bit builds, and / or report this to mingw as a bug. Commented Mar 31, 2013 at 0:50
  • 1
    Can you show us a minimal source file that exhibits the problem? Or does it do this with all source files? Commented Mar 31, 2013 at 2:04
  • 2
    @Rup: I'd be very hesitant to edit system headers. Commented Mar 31, 2013 at 2:04

1 Answer 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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.