JNI--eclipse Configuring the C/D + + development environment

Source: Internet
Author: User

Reprint Please specify source: http://blog.csdn.net/l1028386804/article/details/46622173

Development environment: Eclipse3.2, CDT3.1, MinGW5.1

1. Installation of Eclipse and CDT
Go to Eclipse's official website http://www.eclipse.org to download eclipse.
Install the CDT. The full name of the CDT is C/s + + Developmenttools, a plug-in that enables Eclipse to support C/s development and health. Go to the CDT official website, HTTP://WWW/ECLIPSE.ORG/CDT, then select a mirror site to download the CDT separately. When the download is complete, unzip the two compressed packages into the Eclipse directory or install them via plug-in mode.

< note: The >CDT version has a strict correspondence with the version of Eclipse, and the installation is unsuccessful if the version corresponds incorrectly.
(You can also install the CDT with Eclipse's software update feature after Eclipse is installed, and you can refer to Eclipse's online documentation for details.) )

3, installation MinGW
Now this C + + IDE is not running because of the lack of important parts. This part is the compiler for C/s + +. Under the Windowsos we can choose MinGW. To MinGW's website http://mingw.sourceforge.net, download MinGW, install. After installation, to configure
4. Add Environment variables

Right-click My Computer, properties, high-level environment variable, add to system variable
Mingw_home=c:/mingw
Library_path =%mingw_home%/lib
C_include_path =%mingw_home%/include
Added at the end of the path variable;%mingw_home%/bin

5, Configuration MinGW
Because the eclipse presets are used to compile files that are make.exe but MinGw the file name of the make after installation is Mingw32-make.exe
So we need to rename Mingw32-make to make!.

6. Configuring Eclipse

In order for the CDT to be compiled with MinGW, it needs to be set in Eclipse
Window->preferences->c/c++->make->newmake project->new Builder
->binary Parser Cancel Elf Parser re-election PE Windowsparser

Another issue to note is that the CDT problem, when establishing indexer for C + + files, is stuck at 75%, and CPU usage is usually 100%, and the only solution to know is to turn off the indexer feature window-> Perferences->c/c++-->indexer Hook off the checkmark in front of the apply indexer to all projects.

7. Create, compile, C + + engineering

New Project->standard make C + + project-> fill in the project name Helloc,finish.

Create a "hello.cpp" file under the project

/   * * hello.cpp */   #include <iostream>   using namespace std;     int main () {       //Say Hello five times for       (int index = 0; index < 5; ++index)         cout << "helloworld!" & lt;< Endl;       char input = ' I ';       cout << "To exit, press ' m '" << Endl;       while (input! = ' m ') {           cin  >> input;           cout << "Just entered" << input                << "You need to enter M to exit." << Endl;       exit (0);   }
Create a Makefile file again

All:hello.exe clean     :   rm hello.o hello.exe     hello.exe:main.o   g++-g-o Hello hello.o     main.o:   

Notice that the beginning of the makefile is indented with tab instead of space. If the compile-time prompt No separator ... There's a problem here.

Open the Window->show view->make targets view, right-click Add make Target,target name to fill in the compile, clicking Create created successfully.

In the Make targets view, double-clicking compile executes successfully, and Hello.exe files are generated under Project Helloc. --done.

Problems:

1, the runtime appears: "Launch failed no binaries" error.

2. "Error launching Builder (make-k All)" appears when build project

3. After the CDT plugin is installed, the C, C + + project cannot be found in the Eclipse New Project Wizard.

On the internet to see a lot of friends in the use of ECLIPSE+CDT will appear above three errors, I also appeared in the initial installation, according to my article step-by-step, the first two errors will be solved. The third phenomenon is that the CDT version does not match the Eclipse version, and the issue is resolved by replacing the appropriate CDT version.


JNI--eclipse Configuring the C/D + + development environment

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.