问题描述
我正在尝试在mingw gcc下编译一个c程序.该程序使用__uint128_t
整数.当我尝试在同一64位计算机上根据标准ubuntu gcc对其进行编译时,它可以完美运行.但是,当我尝试在mingw下为Windows编译它时,它甚至根本无法识别__uint128_t
关键字.这是什么意思? mingw下没有128位整数吗?如果不是,是否有Windows的编程语言具有本地(和FAST)128位整数?
I'm trying to compile a c program under mingw gcc. This program is using an __uint128_t
integer. When I try to compile it under the standard ubuntu gcc on the same 64-bit machine, it perfectly works. But then, when I try to compile it for windows under mingw, it simply doesn't even recognize the __uint128_t
keyword. What does this mean? There aren't 128 bit integers under mingw?If not, is there any programming language for windows which has native (and FAST) 128 bit integers?
推荐答案
但是,当我安装 TDM-MinGW64 ,它可以很好地编译(将x64编译器添加到C :: B之后).因此,请确保您的mingw构建针对x64(带有-m64
),并且是mingw的x64构建,因为__uint128_t
是可选的x64 ABI扩展.
I was able to get the same problem using Code::Blocks and the default mingw install (which is IA32 btw), however, when I installed TDM-MinGW64, it compiled fine (after adding the x64 compiler to C::B). So make sure your mingw build is targeting x64 (with -m64
) and it is an x64 build of mingw, as __uint128_t
is an optional x64 ABI extension.
无论使用哪种Windows IDE都不会将__int128_t
用作关键字,因为它是特殊的GCC扩展名(如上所述).
whatever windows IDE you are using won't pick up __int128_t
as a keyword though, as its a special GCC extension (as mentioned).
这篇关于__uint128_t在Mingw gcc上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!