[英]Installing Nachos 3.4 Error cast from void* to int loses precision
I'm trying to install Nachos 3.4, I'm using Linux 64 bit and I have a problem, the error is casting from void* to int loses precision [-fpermissive]
.我正在尝试安装 Nachos 3.4,我使用的是 Linux 64 位,但我遇到了一个问题,错误是
casting from void* to int loses precision [-fpermissive]
。 I have searched many times and tried many ways such: using intptr_t
, long
, ,static_cast<int>
and so on.我已经搜索了很多次并尝试了很多方法,例如:使用
intptr_t
、 long
、 ,static_cast<int>
等等。 But they didn't work, I can not use C or C++ library like stdint.h
, cstdint.h
, iostream
, ... I also intend to use a cross-compiler but I have no clue.但它们没有用,我不能使用 C 或 C++ 库,如
stdint.h
、 cstdint.h
、 iostream
……我也打算使用交叉编译器,但我不知道。 Please help me, thanks very much.请帮助我,非常感谢。
Nachos is 32-bit only. Nachos 仅支持 32 位。 You are essentially trying to compile it for 64-bit, and it won't work;
您实际上是在尝试为 64 位编译它,但它不起作用; it is written to work only on ILP32 data model .
它只适用于ILP32 数据模型。 It also requires GCC 3.4 , as it expects literal string constants to be mutable, and later GCC versions do not support that option,
-fwritable-strings
, at all: the code may compile without the flag, but the binaries segfault.它还需要GCC 3.4 ,因为它期望文字字符串常量是可变的,并且更高的 GCC 版本根本不支持该选项
-fwritable-strings
:代码可以在没有标志的情况下编译,但二进制文件段错误。
In essence, nachos is horribly outdated.从本质上讲,玉米片已经过时了。
Your best bet is to install Debian 3.1r8 in a virtual machine (virtualbox for example), and compile and run Nachos there.最好的办法是在虚拟机(例如 virtualbox)中安装Debian 3.1r8 ,然后在那里编译和运行 Nachos。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.