《操作系统》课程编译nachos问题与解决方法总结

来源:互联网 发布:淘宝店铺隐藏优惠券 编辑:程序博客网 时间:2024/06/08 12:31

问题:error:从‘void*’到‘int’的转换损失精度

原因:64位系统上的void*占8字节,转换为int为4字节将会损失精度。
解决:可以在编译时加上-m32选项让编译器以32位应用程序编译。
参考:
http://blog.csdn.net/sky_qing/article/details/11650497
http://blog.csdn.net/chaoyue1216/article/details/6860034

问题:/usr/include/gnu/stubs.h:7:27: error:gnu/stubs-32.h:No such file or directory

针对 the RHEL/CentOS 5.x

 yum -y install glibc-devel.i386

针对 the RHEL/CentOS 6.x

yum -y install glibc-devel.i686 glibc-devel

参考:http://www.educity.cn/wenda/566626.html

问题: /usr/bin/ld: cannot find -lstdc++

安装libstdc++:

sudo yum install libstdc++

提示have installed already



继续找原因,在这里找到解了:http://stackoverflow.com/questions/13195110/matlab-kalman-usr-bin-ld-cannot-find-lstdc
原因是老师的nachos是32位的application, 尽管他修改过,给了我们64位的,仍然存在部分库不支持。
解决方法:

sudo yum install libstdc++-devel.i686
0 0
原创粉丝点击