简体   繁体   English

为什么我不断收到此错误?

[英]Why do I keep getting this error?

I've tried downloading the file from Safari and I've also tried downloading the file from Firefox, but no matter what, when I try to compile my files along with the object files, I keep getting this error: 我尝试过从Safari下载文件,也尝试过从Firefox下载文件,但是无论如何,当我尝试将文件与目标文件一起编译时,总是出现此错误:

print-all32.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status

Here's how I compile my files and the object file: 这是我编译文件和目标文件的方法:

$ gcc -ansi -Wall -Werror -lm -o myprint-all print-all32.o grove.c

I can't figure out why this keeps happening. 我不知道为什么这种情况持续发生。 Help is greatly appreciated because this will probably become a very big issue in future programming projects/assignments. 非常感谢您的帮助,因为这在将来的编程项目/任务中可能会成为一个非常大的问题。

And if you need it, here are the object files/other files I need to download: http://users.csc.calpoly.edu/~dekhtyar/101-Fall2013/labs/lab5.html 如果需要的话,这里是目标文件/我需要下载的其他文件: http : //users.csc.calpoly.edu/~dekhtyar/101-Fall2013/labs/lab5.html

Two things to check first. 首先要检查两件事。

  1. Are you using the files which are compatible with your system (32 bit or 64 bit) 您是否使用与系统兼容的文件(32位或64位)
  2. Can you run 'make clean' before you compile the files. 您可以在编译文件之前运行“ make clean”吗? Can you regenerate the object file in your own system rather than using the object file supplied by the instructor. 您是否可以在自己的系统中重新生成目标文件,而不是使用讲师提供的目标文件。

Regards 问候

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

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