无法编译 Brian Gladman aes 库
我一直在从这里编译布莱恩·格莱德曼的图书馆 www.gladman.me.uk 我能够在本地计算机(ubuntu 10.10)上编译该库,但是当我尝试在远程计算机(CentOs 5.4)上编译时,它会使用 gcc 生成大量错误。
生成的错误是 此处
感谢您的建议 ..
I have been compiling brian gladman's library from here www.gladman.me.uk
I am able to compile the lib on my local machine(ubuntu 10.10) but when I try to compile on my remote machine(CentOs 5.4) it generates numerous errors with gcc ..
The error generated are here
thankx in adv ..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
编译中的第一个错误是
(之前只是可能指出问题的警告,但它们不会导致编译中断。)
问题是未定义 BRG_UI64,更具体地说是 uint_64t 类型。定义之前发生。下面的问题大部分是因为uint_64t没有定义而存在的,所以同样的原因。
本质上,它在不同的无符号类型中查找最大值为 18446744073709551615u 的第一个类型,即完整的无符号 64 位整数,并将其定义为 uint_64t。如果未找到类型,则使用 #error 引发上述错误。
因此,远程系统上的 UINT_MAX、ULONG_MAX、ULLONG_MAX 或 ULONG_LONG_MAX 似乎都不是 18446744073709551615 。
您可以使用一个简单的程序检查常量的值。
在我的系统上(也许在您的系统上)有多个版本的limits.h和climits(包含在一些c++-includes中)。 找到它们
您可以通过“我无法帮助您移植库” 。如果您不知道自己在做什么,我认为自己定义类型不是一个好主意(尽管具有更大最大值的无符号整数类型可能会起作用)。
如果其他编译器不能为您解决问题,最好联系作者寻求修复。
这些常量取决于系统和编译器。因此,它在本地计算机上工作但在远程计算机上不起作用的原因可能是:
以下是这些计算机的代码谁可能比我更了解那些依赖于平台的东西。
The first error in your compilation is
(before are only warnings which might point to problems, but they don't cause your compile to break.)
The problem there is that BRG_UI64 was not defined, more specifically the type uint_64t. The definition takes place previously. Most of the following problems exist because uint_64t is not defined, so the same reason.
Essentially it looks among different unsigned types for the first that has a max value of 18446744073709551615u, i.e. a complete unsigned 64bit integer and defines that as uint_64t. If no type is found the above error is raised by using #error.
So it seems neither of UINT_MAX, ULONG_MAX, ULLONG_MAX or ULONG_LONG_MAX is 18446744073709551615 on your remote system.
You can check the values of your constants with a simple program
There are several versions of limits.h and climits (which is included by some of the c++-includes) on my system (and perhaps on yours as well). You can find them with
I can't help you porting the library anyway. I don't think defining a type on your own is a good idea if you don't know what you are doing (though an unsigned integer type with a bigger max value might work).
If a different compiler doesn't solve the problem for you it is probably best if you contact the author for a fix.
Those constants are system and compiler-dependent. So reasons why it works on your local, but not on the remote machine might be:
Here is the code for those who might have more insight into those platform dependent stuff than me.
第一个错误位于 brg_types.hat 第 138 行;
我在此处找到了该文件的在线副本(可能是不同的版本)。因此,您需要了解如何创建 64 位无符号整数,并在该行上方添加一些定义,例如
,如果
unsigned long long
是 64 位,并且您输入诸如0x123456789ull
之类的文字数字代码>.看起来需要更多的移植才能在编译器上编译它。
The first error is on brg_types.hat line 138;
I found here a online copy of that file (maybe a different version). So you need to find how to create a 64 bit unsigned integer, and add some defines above that line, for example
if
unsigned long long
is 64 bit and you enter literal numbers like0x123456789ull
.And it looks like there will be more porting required to compile this on your compiler.