简体   繁体   English

如何在Eclipse中打开tar.gz文件

[英]How to open tar.gz files in eclipse

If I downloaded a tar.gz file on my computer and extracted it with code in it, how do I run it in eclipse in Linux (for C). 如果我在计算机上下载了一个tar.gz文件并用其中的代码提取了该文件,那么如何在Linux中的eclipse中运行它(适用于C语言)。 The downloaded files contains .c files and .o files. 下载的文件包含.c文件和.o文件。

I can't help with Eclipse, but I can help you compile and run the code. 我无法使用Eclipse,但可以帮助您编译和运行代码。 Ok, to extract: 好的,提取:

tar -xvzf name_of_your_archive_file.tar.gz

In the above, 'x' means e x tract, while 'v' means v erbose, 'z' means .tar.g z compression, and 'f' stands for f ile (because you specify the name of the .tar.gz file immediately after the invocation). 在上文中,“x”表示E X系,而“V”是指v erbose,“Z”是指.tar.gž压缩,和“F”代表对于f ILE(因为你指定的.tar的名称。调用后立即添加gz文件)。

Now that you have extracted the archive, you can navigate into it with: 现在,您已经提取了档案,您可以使用以下命令导航到其中:

 cd name_of_your_archive_file

After which you can list the directory contents: 之后,您可以列出目录内容:

 ls

The '.o' files you mentioned aren't really helpful, unless they were compiled for your architecture ('.o' files are build products that typically need to be generated for each different type of OS and CPU type). 除非您为您的体系结构编译了“ .o”文件,否则它们并没有真正的帮助(“ .o”文件是通常需要针对每种不同类型的OS和CPU类型生成的生成产品)。

Any well-made project will contain a file name 'README' that explains how to build the project. 任何制作精良的项目都将包含文件名“ README”,以说明如何构建该项目。 You can use the 'cat' command (which stands for 'concatenate'... it will eventually make sense) to display the content of the 'README' file like so: 您可以使用“ cat”命令(其代表“ concatenate” ...它最终会有意义)来显示“ README”文件的内容,如下所示:

cat README

If the README is very long, you can make it show you only a portion by using the less command: 如果自述文件很长,则可以使用less命令使它仅显示一部分:

cat README | less

Now, if there is no README or it doesn't tell you how to build the project, but there is a file named 'Makefile', then you would ordinarily build the project by invoking the following command: 现在,如果没有自述文件或没有告诉您如何构建项目,但是有一个名为“ Makefile”的文件,那么通常可以通过调用以下命令来构建项目:

make

You're probably doing it wrong. 您可能做错了。 Most Eclipse extensions prefer to be loaded via Help ➤ Install New Software... 大多数Eclipse扩展都倾向于通过帮助➤安装新软件...来加载。

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

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