Internal Builder: Cannot start the g ++ program: the system cannot find the specified file

****** Internal Builder is used for build ****** g++ -ot1.o ..\t1.cpp Internal Builder: Cannot run program "g++": The system cannot find the file specified. Build error occurred, build is stopped 

I'm new to eclipse, on Windows XP, I want to run c / c ++ progms + linux build (cygwin is installed with the necessary packages)
The above error goes and the assembly fails! Please suggest.

Edit: added to the env variable of the path as e:\cygwin\bin;

This is for reference:

alt text

+4
source share
4 answers

How do you set up your Cygwin toolchain in your Eclipse CDT ?
(from Alex Wu an excellent Alex Tech Blog post)

1 / Install Cygwin correctly, you will need the following packages:

 binutils gcc gcc-core gcc-g++ gcc-mingw-core gcc-mingw-g++ make gdb (needed if you want to support debug in eclipse) 

you can check your cygwin installation with the command cygcheck -c

alt text

2 / Add %cygwin%\bin to your env PATH , then open the eclipse. you will find that the cygwin toolchain will be shown when you open the new c / cpp project wizard.

alt text

3 / Configure GDB.

Go to Windows->Preference->C/C++ -> Debug -> Common Source Lookup .
Add the following "Path Display":

 \cygdrive\c -> c:\ \cygdrive\d -> d:\ other drives if any ....... 

alt text

+3
source

I just ran into the same error; this was my first experience using eclipse with cygwin. I am new to Eclipse, but I was impressed with how strong it is. Unfortunately, this question was asked almost a year ago. Meanwhile, the software may have changed so much that my advice below may be a bit of an anachronism regarding this issue.

I am using the Eclipse IDE for C / C ++ developers Helios Service Release 2 version 1.3.2.20110218-0812

uname says Cygwin version is CYGWIN_NT-6.1-WOW64

After following the (often outdated) advice of many web posts on this subject, two things seemed to make it work. My system administrator, who only has privileges to install the software, needs to increase my permissions on the cygwin / bin folder, which now stands as Read and Execute. Secondly, in eclipse I changed the type of the builder to External: File> Properties C / C ++ Build, the type of Builder: external builder. The assembly now works, although not without warning. I am still confused about the many subtleties of the installation, and I'm not sure why switching to an external builder made such a difference.

+1
source

I agree with @pajton, you need to adjust the expected Eclipse of the Cygwin binary path from c:\cygwin\usr\bin to c:\cygwin\bin , since the authors of Cygwin changed to the / usr / bin installation from the latter.

I needed to change the Eclipse addition of the Cygwin binary directory in PATH from c:\cygwin\usr\bin to c:\cygwin\bin in two places in the configuration of my Juno developer build 20120322-1740:

  • Project Properties / C / C ++ Build / Environment

  • Run / Run Configurations ... / Environment

I also changed the shell interpreter path in the Compiler invocation command detection option from sh to c:\cygwin\bin\dash.exe ,

  • Project Properties / C / C ++ Build / Detect Features / Cygwin C Compiler

  • Project Properties / C / C ++ Build / Detect Features / Cygwin C ++ Compiler

This made it possible to automatically fill in the include directories and built-in macros in Project Properties / C / C ++ General / Paths and Symbols.

Since only programs created by Cygwin, such as bash.exe , dash.exe allow portable symbolic links in the Cygwin style, I changed the compiler call commands from gcc to gcc-4 and from g++ to g++-4 .

  • Project Properties / C / C ++ Build / Settings / Tool Settings / Cygwin C ++ Compiler

  • Project Properties / C / C ++ Build / Settings / Tool Settings / Cygwin C Compiler

  • Project Properties / C / C ++ Build / Settings / Tool Settings / Cygwin C ++ Linker

Perhaps this will be done automatically, as I see a change in the git repository that needs to be resolved,

When I researched my problem, I went to Help / Install New Software ... / Juno / Programming Languages ​​/ C / C ++ Development Tools.

When I tried to update the selected fragment, I got an unclear message that the required update was required by other parts. When I clicked Finish, I received an invitation to restart. I do not know if my CDT updated these steps.

If you want to catch access violations at run time, create an external tool entry in Run / External Tools ... / Configure External Tools. Set c:\cygwin\bin\bash.exe as the program, ${workspace_loc:/PROJECT_NAME/CONFIG_NAME} , for example ${workspace_loc:/test/Release} , as the working directory and the command parameter followed by the name of the program, for example -c "./test.exe" in the arguments. I found that c:\cygwin\bin\dash.exe does not route the stack trace generated by the Cygwin DLL to stderr caught by Eclipse.

0
source

Another way to fix this is to go to

 project properties / c/c++ build / settings / tool settings / cygwin C compiler 

and change the command to

 sh -c 'whatever was already there' 

Sh will be used to invoke this command, and thus it will resolve cygwin links. You will also have to do this for assembler and linker. Of course, you should also make sure your path points to c: \ cygwin \ bin before running eclipse.

0
source

Source: https://habr.com/ru/post/1306466/


All Articles