简体   繁体   English

使用 64 位扩展编译 disksim4 时出现 Linker 错误

[英]Linker errors when compiling disksim4 with 64-bit extensions

I'm trying to compile the Disksim4 simulator with dixtrac.我正在尝试用 dixtrac 编译 Disksim4 模拟器。 I've followed the instructions from here: http://cighao.com/2016/03/23/disksim-with-ssdmodel-source-analysis-013-use-it-on-64bit/ to install the SSD patch along with the 2 patches recommended on that page.我已按照此处的说明进行操作: http://cighao.com/2016/03/23/disksim-with-ssdmodel-source-analysis-013-use-it-on-64bit/安装 SSD 补丁以及该页面上推荐的 2 个补丁。

All the required files compile (however with many warnings about implicit function declarations).所有必需的文件都会编译(但是有许多关于隐式 function 声明的警告)。 However, it fails at the following command:但是,它在以下命令中失败:

gcc -Wall -Wno-unused -MD -I. -I../diskmodel/include -I../libparam/include -I../libddbg/include -g -DASSERTS   -I../memsmodel/include -I../ssdmodel/include -D_INLINE  -o disksim disksim_main.o -L. -ldisksim -L../diskmodel/lib -ldiskmodel -L../memsmodel/lib -lmemsmodel -L../ssdmodel/lib -lssdmodel -L../libparam/lib -lparam -L../libddbg/lib -lddbg -lm

For example,例如,

./libdisksim.a(disksim.o): In function `addlisttoextraq': /home/karthik/school/disksim-4.0/src/disksim.c:235: undefined reference to `addtoextraq'

All the errors are similar to the one above.所有错误都与上述错误类似。 Not sure how to proceed to fix this.不确定如何继续解决此问题。 If anyone is familiar with this and has any suggestions, I would greatly appreciate it!如果有人对此熟悉并有任何建议,我将不胜感激! thank you!谢谢你!

This error comes from the higher version of GCC. I've seen this error too when I try to make in the disksim-4.0 directory using GCC-10 and GCC-9.这个错误来自GCC的高版本。我在用GCC-10和GCC-9在disksim-4.0目录下make的时候也遇到过这个错误。 After searching a lot of information, finally I found that it is the version of GCC that causes this error.查了很多资料,最后发现是GCC的版本导致了这个错误。

Switch to a lower version of GCC (I switched to GCC-4.9), then just make in the disksim-4.0 directory as above.切换到低版本的GCC(我切换到GCC-4.9),然后在disksim-4.0目录下make如上。 Now you can successfully compile disksim-4.0!现在就可以成功编译disksim-4.0了!

If you do not know how to install a lower version of GCC, here is the link: Install lower version of GCC .如果您不知道如何安装低版本GCC,链接如下: 安装低版本GCC

Also, here is the link that tells you how to install multiple versions of GCC in your Linux and the way to switch between them: How to switch between multiple GCC and G++ compiler versions on Ubuntu 20.04 LTS .此外,这里的链接告诉您如何在 Linux 中安装多个版本的 GCC 以及在它们之间切换的方式: 如何在 Ubuntu 20.04 LTS 上的多个 GCC 和 G++ 编译器版本之间切换

FYI.供参考。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM