Compile open-source programs using eclipse in Linux

Source: Internet
Author: User

Compile open-source programs using eclipse in Linux



In Linux, we can use eclipse to compile and debug open-source programs. In this way, we do not need to use the command line all the time. It is very convenient. We will take gxemul as an example to introduce it:


1.

In http://gxemul.sourceforge.net/download gxemul, my version is 0.6.6.Gxemul is an open-source multi-processor architecture simulator that can simulate arm, MIPS, PPC, etc.



2.

Unzip gxemul:

Tar-zxvf gxemul-0.6.0.tar.gz

CD gxemul-0.6.0

First, we need to configure to generate the MAKEFILE file, which is the MAKEFILE file we use.

./Configure



3.

Gxemul is a C ++ project, so we open eclipse and selectFile --> New --> C ++ Project, Enter the Project name:GxemulAnd fill inGxemul decompression path, As follows:





4.

Since we have generated makefile in step 1, we need to tell eclipse not to generate makefile automatically,Select the gxemul project, right-click, and select Properties:





5.

Deselect "generate makefiles automatically" under C/C ++ builder", As follows:





6.

Then start compilation. The compilation output in eclipse is as follows:






7.

After the compilation is complete, run the command at http://blog.csdn.net/htttw/article/details/7724785. We use qemu_mipsas an example:

Wget http://wiki.qemu.org/download/mips-test-0.2.tar.gz
Tar zxvf mips-test-0.2.tar.gz



8.

Select the gxemul project, right-click, and choose run as --> RUN deployments. In the second arguments, enter:

-E qemu_mips -x -M 128 -o 'console=ttyS0 rd_start=0x80800000 rd_size=10000000 init=/bin/sh' 0x80800000:mips-test/initrd.gz mips-test/vmlinux-2.6.18-3-qemu

Enter the preceding parameters in the console when running gxemul:
. /Gxemul-e qemu_mips-X-M 128-O 'console = ttys0 rd_start = 0x80800000 rd_size = 10000000 init =/bin/Sh' 0x80800000: MIPs-test/initrd.gz MIPS-test/vmlinux-2.6.18-3-qemu

Is the same


Note: You must enter the preceding parameter path according to the decompressed path in step 3!



9.

Run it with eclipse. The result is as follows. Note that the window in the middle is the Linux running in gxemul:







Done!


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.