__int128 error when compiling 32 bit

廉价感情. 提交于 2019-11-30 04:15:19

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/15725167/int128-error-when-compiling-32-bit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!