Solution for launch failed,binary not found problem in Eclipse C + + (Win environment)

Source: Internet
Author: User

This post was excerpted from http://blog.sina.com.cn/s/blog_88fcfaba0101755q.html

Recently while writing Java, while writing C + +, so often switch between Eclipse and VC, it can be said that the two code editor to the experience is completely different. At least in terms of design, the human nature of Eclipse is absolutely not. So today I'm thinking about getting an eclipse C + + to use, so you can avoid the pain of switching between VC and Eclipse often.

However, after installing Eclipse, run the code and find the prompt "Launch failed,binary not Found". After a while, I still can't get it done. Had to surf the internet to see what a good way to solve the net friends.

Although the internet is omnipotent, but in fact, the online mixed with a variety of error messages, you need to be patient, seriously to identify the results you want.

What I can tell you is that I succeeded in the end. Let me tell you the complete solution.

First of all, we must clearly show the "Launch failed,binary not found" the root cause. This is actually the hint because you don't have the Eclipse and C + + compilers together. Specifically, Eclipse cannot find a C + + compiler to compile the code.

Don't worry, if you say you have installed the corresponding compiler (such as g++) as the Netizen said, but eclipse still prompts "Launch failed,binary not Found", then you should know. It's probably not a system configuration problem, it's your own problem. Well, don't worry, just look back.

To build an eclipse C + + working environment. You must first have a C + + compiler. Here I still choose the current mainstream--mingw on the internet

First step: Install MinGW

Here is not provided, a large number of online download links, I will not send more. The installation process is simple, next, select Download and install, Next, Next, select Current. The following screen, as long as the MinGW base tools and g++ compiler selected on the OK (that is, the first two)

Step Two: Configure environment variables for MinGW

Okay, here we go. If you follow the prompts to install the MinGW, the next step is to configure the MINGW environment variable. Here, do not rush, need patience, as long as this step, the later things will become much simpler.

Environment variables, advanced system settings, properties----Right My Computer

On the inside, follow the steps below to add the changes:

1. Create a new mingw_home variable with the value of your MinGW installation directory, for example, my installation directory is in D:\software\MinGW

2. Add%mingw_home%\bin to the path variable;

3. Create a new Library_path variable, if any, add%mingw_home%\lib to the value, which is the location of the standard library

4. Create a new C_includede_path variable with the value set to%mingw_home%\include

5. Create a new Cplus_include_path variable with the value set to%mingw_home%\include\c++\3.4.5;%mingw_home%\include\c++\3.4.5\mingw32;%mingw_home %\include\c++\3

.4.5\backward;%mingw_home%\include

Note that these five steps must be checked carefully every step, otherwise it is likely to affect the subsequent steps.

If you follow the above steps to configure the environment variables, it is basically OK. I am a very confident person, I think if you follow my steps, basically do not need to test. But if you are not sure, then you can try, method: First write a piece of code, save as Code.cpp, of course, must be correct, and then run CMD, the CD command to go to the folder where the code (if not I suggest you go back to learn the DOS command), and then enter the g++ Code.cpp-o code_compiled, and then find the directory where you store the code to see if you have generated an executable program called Code_compiled.exe, if so, you have succeeded. Then I'm going to step three.

Step three: Test eclipse

Haha, actually to this step, basically completed. Many tutorials on the web after the MinGW configuration and a lot of follow-up steps, in fact, in my opinion is already big can not need. Why do you say that? Look down and you'll know.

Open Eclipse C + +, mine is the latest version of Juno. Create a C + + project right away!

Select File->new->c++ Project, after you have entered project name, remember to select MinGW GCC in the box at the bottom right, which is called Toolchains, and then finish directly. ()

Next you want to create a source file, which is the same as the project you created right-->new->source File, and then input the code you want to enter later, the next run. It's important to do something before you run it. Look at the picture:

Click the Run->run configurations in the menu, pop up the window, then click on the Enable auto build in the diagram, then press apply, then close the window. Here to explain: a friend who used VC may know that in the VC you save the code after the run it will prompt you whether to compile, but in eclipse will not, if you do not build the compiler to run the program, it will prompt you "Launch failed,binary not Found ", so here are some of the reasons why some friends installed the corresponding compiler still prompt" Launch failed,binary not Found ". An option like this is that eclipse will automatically help you compile the program before you run the program, eliminating the hassle of compiling your own.

OK, let's run your code and see if it will prompt "Launch failed,binary not Found"? I don't think so.

Solution for launch failed,binary not found problem in Eclipse C + + (Win 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.