Eclipse Helios-"cannot run program 'make' : unknow reason" on Mac OS X - c++

I am a college undergraduate trying to learn C++ programming on my Macbook. It is installed with Mac OSX 10.7.3.
I have been trying to build the "hello world" project on Eclipse Helios, but after I clicked on the build project button, it keeps telling me "cannot run program 'make : unknow reason".
I noticed this post but it seems to be for the Windows OS instead of MAC OS, and I don't quite follow the instructions in it either (sorry I don't have any familiarity with programming...). The description for PATH variable is "not available" and I don't know if this is a problem. I'm also confused about what to put in the "Name" slot.
Edit:
Now after some trials I have "make" in my PATH. (i.e. the command line gives the information of the make after I input "make --version") and my PATH is set to
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/texbin
However the same problem still persists. Can anybody please help? Thank you!!

My suggestion is to install Xcode (http://itunes.apple.com/se/app/xcode/id497799835?mt=12) from the App Stor (for Mac). Xcode is (free) developer tools supplied by Apple. After installing Xcode you can go to the menu 'Xcode' -> 'Open Developer Tools' -> 'More Developer tools' that will take you to apple developer site (where you probably have to register) and where you can download 'Command Line Tools for Xcode' that will contain make etc. for unix style development.
Xcode is quit nice and if there is no demand to use Eclipse when you could probably do well with Xcode.

EDIT: Undeleted this answer as it turned out to be correct.
Yes, I'd say that $PATH was the problem.
Your system default version of $PATH should be sufficient and if not then set it correctly in your .profile or .bash_profile. You'll need to logout and back in for these changes to take effect. Doing this will mean that you can compile from the command line without going into eclipse, which is something you'll want to do at some point.
Now simply configure eclipse to avoid setting any build variables and all should be well. Under Window > Preferences > C/C++ > Build > Build Variables, the list should be empty:

Related

"Could not determine which "make" command to run. Check the "make" step in the build configuration." Qt creator

I installed several times the qt creator but it never cost me as much as in my current PC; First I used the installer that always had on my Pendrive (that of Qt 5.8), told me that I could not download some repositories, I downloaded version 5.9 of the same installer, with the same result. After trying to install it several times and it did not load I went to another house where I managed to install it, although I had to be very aware of many errors coming out of missing libraries (while installing Qt 5.9). After this I had to download the sp1 for my win7 OS through "windows updates" to run the Qt creator, but later, when loading, creating or running a project, I would say in console (it does not matter if it is GUI) the following : "Could not determine which" make "command to run. Check the" make "step in the build configuration." I would very much appreciate your help to anyone who wants to advise me, because I have already had many problems with my computer, from losing everything (the previous hard drive had installed original win10) to a series of very annoying setbacks like this. I cannot post images, I have no more than 10 reputations.
edit 1: there are the images:
https://ibb.co/jcNp05
https://ibb.co/hMyU05
The problem is that the video you posted is for linux, but i thank you for your help. I need now more he
You have to set a valid compiler to build your project. As any compiler is not set, it is asking you to check the configuration.
For example in my PC, I get the following as compiler output:
11:13:33: Running steps for project ListViewExample...
11:13:33: Configuration unchanged, skipping qmake step.
11:13:33: Starting: "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe"
C:/Qt/Qt5.2.1/Tools/mingw48_32/bin/mingw32-make -f Makefile.Debug
Here you can observe that C:/Qt/Qt5.2.1/Tools/mingw48_32/bin/mingw32-make is the make compiler which builds the application.
You can set the compiler path here:
Tools > Options > Build & Run > Kits. Select the kit displayed and select a
valid compiler.
How to add mingw compiler at the time of installation
Reference Video for similar issue
You can try this youtube video link. Hope this solves your problem.

Debugging fails with QtCreator on OSX

I have OSX Yosemite 10.10.5, QtCreator 4.1.0, Qt 5.7.0 and Xcode 7.2.1.
If I write any native C++ program in QtCreator (console, gui - anything) I am unable to debug that program from QtCreator. Breakpoints get ignored, the program executes without pause and runs to completion no matter what I try.
I have tried the Xcode's LLDb, system GDB and Homebrew GDB as debuggers. the versions of GDB fail to start. Homebrew GDB has been codesigned.
This all used to (a few year back) just work beautifully and I am at a loss as to what might have changed.
Curiously, if I generate an exception inside the program - like accessing through a null pointer, the debugger shows me where this happens in just the way I would expect so, presumably, the debugger is running but simply treating me with complete disdain.
I know there are many versions of this question but none seem to address the problem adequately or offer workable solutions, or they apply to much older versions of the products.
Any suggestions?
This version of qtCreator (4.1.0) saw the return of the warning about having the build directory at the same level as the project directory. In Windows, this is done automatically. My mac installation does not get it right. (I may have messed a while back - cannot remember).
So - if the build directory is inside the project directory, debugging fails. Move the build directory up to the same level as the project directory and everything seems to work fine.
You can set the default build directory in the preferences/Build & Run dialogue. The path should start with ../
You will need to think about the folder structure before setting up the project unless you want build folders appearing in awkward places. So, a project folder structure like this is OK:
But one like this is not:
If this was already obvious to you, great. I have been messing with this for ages.
Many thanks to those who replied and anyone else who took the time to read the question. What helped e find it was the suggestion by #AlexanderVX that his setup was the same as mine but his worked. The only bit of my setup he could not see in the screenshots was the start of the build path. So that was the clue.

Can't run C++ in NetBeans: "No Shell Found" error

I'm trying to learn C++ using NetBeans but even though I have CYGWIN and everything set up in my PATH, I keep getting an error that says: "No shell found. Cannot proceed. Please install either CYGWIN or Msys."
I don't know what Msys is but since the error says "or" I assume that if I have CYGWIN that I don't need to have Msys.
I'm trying to run the basic "Hello World!" tutorial but this error from what I've seen isn't covered. I'm getting aggravated because I have a project I need to have done in a few weeks.
If anyone has any answers for me, that would be great. I can supply screenshots if you need them.
Cygwin alone is not enough, first of all you have to check if you installed C++/gcc/gdb packages in your Cygwin.
From Cygwin/Net beans docs:
Open the Control Panel (Start > Settings > Control Panel) and double-click the System program.
Select the Advanced tab and click Environment Variables.
In the System Variables panel of the Environment Variables dialog, select the Path variable and click Edit.
Add the path to the cygwin-directory\bin directory to the Path variable, and click OK. By default, cygwin-directory is C:\cygwin. Directory names must be separated with a semicolon.
Click OK in the Environment Variables dialog and the System Properties dialog.
If it fails you could try to Re-Install Netbeans from/within an cygwin/bash instance start the netbeans from a cygwin/bash instance.
Netbeans should automatically detect gdb/g++
PS: I'd prefer to use a good Gnu/Linux distro
I had the same problem with 8.1.
Adjusting the %PATH%-variable - in my case adding C:\msys64\usr\bin - solved it (as wdavilaneto's slightly verbose answer suggested).
This is not an answer but it adds to this question, I know that isn't very objective but in this case there may be a problem with Netbeans. I have 7.3 so this could be the reason. I am getting the same error but it used to work just fine, then one day it just stopped working and couldn't find the Shell. I have everything you need to make C/C++ work for Netbeans and it was working, for a while too!
It is rather old, but I've had the same issue a moment ago. It "Solved itself" by Creating a new "welcome sample" project and then made it run, then went back to my original project and made it run again. For me, it solved the problem. Probably it is related to an issue with Netbeans as Cian said.
Btw, I'm with Netbeans 8.1.
Make sure the shell is in your path! Depending whether you have Cygwin, Mingw32, Mingw32, TDM Mingw... it will be somewhere here:
c:\<installation path>\usr/bin
Hmh, I have 2 C compilers one for 64bit and one for 32bit set in NetBeans. When I had 32bit compiler without 64bit one then compiling went fine but when I have installed 64bit then NetBeans has started to do some problems, firstly everything went fine but then I started to get this problem to. For me fix is to switch from 64bit compiler back to 32bit compiler, then compile my program and then go back to 64bit compiler and now I can compile it with 64bit compile... Not sure why is this fixing it.
I have this problem with Netbeans 10.
Computer is Windows 10 x64.
Resolved by following the answer given by TNT.
Problem was when start building my project the said "no shell" (the topic of this posting) dialog box popped up. Since there was no command prompt, the build tools cannot run - process cannot spawn.
Solution was to give the correct path (environment variable). Since I am using MSYS, Since I am using MSYS, adding
F:\msys64\usr\bin
to my PATH made it work.

Eclipse C++ : "Program "g++" not found in PATH"

I have gpp installed in my Windows 7 (32 bit) as shown in the picture.
PATH variable gas g++
"%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\cygnus\cygwin-b20\H-i586-cygwin32\bin\g++"
Still eclipse shows the error:
"Program "g++" not found in PATH".
How can this be resolved?
Today I have bumped into this problem and solved it in the following way. I pressed "Reset defaults" button everywhere I could find it in Eclipse settings (for example, Preferences/C++/Build/Settings/Discovery). After that the error disappeared and the code compiled successfully.
This is how I got rid of it:
Install the MinGW.
Select all files in the Basic Setup and select apply the changes.
Select new C++ Project You will be able to see "MinGW GCC" in the toolchain section select the same and create project.
You need a gcc, g++ compiler toolchain (on your windows machine) for the eclipse which you have manually downloaded,
One of the options can be done implicit via cygwin installation(by selecting proper development packages for gcc, g++) and then add the location of the compiled gcc ,g++ package like C:\cygwin\etc\alternatives to the PATH variable for windows environment.
After this open eclipse and go to Project->properties->C/C++ Tool Chain Editor and add replace default GNU C++ compiler and GNU C Compiler with Cygwin C++ compiler and Cygwin C compiler and rebuild the project. The errors related to gcc, g++ PATH not found will now be gone.
You need:
C:\cygnus\cygwin-b20\H-i586-cygwin32\bin
in the PATH.
and not
C:\cygnus\cygwin-b20\H-i586-cygwin32\bin\g++
as you wrote.
I got the same problem with mingw-64 (x86_64-4.9.1-release-posix-seh-rt_v3-rev1), Eclipse Luna 4.4.1 and CDT 8.5.0.201409172108, using Windows 7.
I solved this problem by putting the following two environment variables under
Window -> Preferences -> C/C++ -> Build-> Environment
name: MINGW_HOME value: (mingw installation directory without "\bin")
name: MSYS_HOME value: (msys installation directory without "\bin")
You can check
Window -> Preferences -> C/C++ -> Build -> Settings -> Discovery -> CDT GCC
Built-in Compiler Settings MinGW [ Shared ]
, if it doesn't complain "Toolchain MinGW GCC is not detected on this system" then you're all set.
I had the same problem, the only solution that worked for me was this:
Open command-line and check whether "g++" actually executes the compiler
If (1) works, uncheck Project->Build automatically in Eclipse
Clean project
Build project
I had the same problem: Eclipse couldn't find (g++) and (gcc) in PATH even they were accessible from command-line. I was also sure they are pointed by PATH correctly.
I have just deleted the (.metadata) folder from Eclipse's Workspace as a mean to reset it and this worked for me.
The PATH is locate at Project Properties > C/C++ Build > Environment (see screenshot below).
For your reference, I am using MinGW, I got the same error before I got the MSYS install. Later I found out that I also need MSYS to be install because the make.exe wasn't come with MinGW. (I don't this error was cause be MSYS.)
After MSYS is installed, add MSYS and MinGW path into environment variable, restart Eclipse. Remember to rebuild your project in order to rectify the error. If error still persist after restart, recreate the workspace. At least this has solved the problem on my site, hopes this help on you too.
Good luck!
I had a similar problem. The error is raised, but the code is compiled and linked. The error was caused by the Error Parser using a different configuration than the one that is compiled.
The error parser configuration was only valid for the Linux configuration of my software. My active configuration was set for MinGW and Windows.
Solution:
In Elipse under Windows->Preferences->C/C++->Indexer set Build Configuration for the indexer to Use active build configuration.
Clean and rebuild, otherwise the old errors will remain visible
Maybe it has nothing to do here, but it could be useful for someone.
I installed jdk on: D:\Program Files\Java\jdk1.7.0_06\bin
So I added it to %PATH% variable and checked it on cmd and everything was ok, but Eclipse kept showing me that error.
I used quotation marks on %PATH% so it reads something like:
%SYSTEMROOT%\System32;"D:\Program Files\Java\jdk1.7.0_06\bin"
and problem solved.
I had similar problem and I solved it by:
Installing g++ The GNU C++ compiler using Ubuntu Software Center
Changing in: Window -> Preferences -> C/C++ -> Build -> Settings -> Discovery -> CDT GCC Build in Complier Settings [Shared]
from: ${COMMAND} -E -P -v -dD "${INPUTS}"
to: /usr/bin/${COMMAND} -E -P -v -dD "${INPUTS}"
I hope it helps.
I had the same problem in Sublime..
Right click on my computer
Advanced system settings
Environment variables
in system variables, change path to location of '...\MinGW\bin'
Example: D:\work\sublime\MinGW\bin
For me it got fixed with:
Go to:
Window -> Preferences -> C/C++ -> Build -> Environment
Then press "Add..."
Name: MINGW_HOME
Value: C:\MinGW (yours might be different if you choose a custom path)
Hit "Apply and Close"
Now, it shoud work if you did everything correctly
i think cgywin might not work for you as you can only compile your code in Win7 if you fire up the command prompt; you need to use MinGW compiler toolset instead. After you have install your compiler, go to Properties->C/C++ Build->Tool Chain Editor -> Change your current toolchain to MinGW GCC.
WINDOWS 7
If there is anyone new reading this, make sure to simply try a clean install of mingw before any of this. It will save you sooooo much time if that is your problem.
I opened up wingw installer, selected every program for removal, apply changes (under installation tab, upper left corner), closed out, went back in and installed every file (in "Basic Setup" section) availible. after that eclipse worked fine using "MinGW GCC" toolchain when starting a new C++ project.
I hope this works for someone else.
If not, I would do a reinstall of JDK (Java Developer's Kit) and ECLIPSE as well. I have a 64bit system but I could only get the 32bit versions of Eclipse and JDK to work together.
In my case, I didnt mark for instalation the mingw32-gcc-g++ package in the installation manager, that's why eclipse didn't know it.
Needed to go to the instalation manager, mark it (in basic setup tab) and update catalogue
If you have your PATH setup and you can see g++ --version via the command line, then try to delete the project and create a new c++ project.
So the reset defaults might work but I think it has to update the PATH if it wasn't added before.
Had this problem on windows 10, eclipse Neon Release (4.6.0) and MSYS2 installed.
Eclipse kept complaining that "Program 'g++' not found in PATH” and "Program 'gcc' not found in PATH”, yet it was compiling and running my C++ code.
From the command prompt, I could run g++.
Solution was to define the C++ Environmental variable for eclipse called 'PATH' to point to windows variable called 'path' also $(Path).
Menus: Preferences>>C/C++>>Build>>Environment
Looks like eclipse is case sensitive with the name of this environmental, while windows doesn't care about the case.
First Install MinGW or other C/C++ compiler as it's required by Eclipse C++.
Use https://sourceforge.net/projects/mingw-w64/
as unbelievably the download.cnet.com's version has malware attached.
Back to Eclipse.
Now in all those path settings that the Eclipse Help manual talks about INSTEAD of typing the path, Select Variables and
**MINGW_HOME**
and do so for all instances which would ask for the compiler's path.
First would be to click Preferences of the whatever project and C/C++ General then Paths and Symbols and add the
**MINGW_HOME** to those paths of for the compiler.
Next simply add the home directory to the Build Variables under the C++/C Build
Build Variables Screen Capture
All the tips did not work for me using the Gaisler Tools for GR712RC Installation for OS RTEMS.
I'm using the Eclipse Kepler.
The simple way was making a copy of sparc-rtems-gcc.exe to gcc.exe, and sparc-rtems-g++.exe to g++.exe, in the C:\opt\rtems-4.10-mingw\bin directory.
The reason is that eclipse cannot find your gcc or g++ environment variable path.
You might have tried to run c or c++ or fortran but eclipse cannot find out the compiler.
So, add the path in your environment variable.
Windows -> Search -environment variables -> click on environmental variables at bottom.
Click on path ->edit -> new -> your variable path
Path should be entire, for example:
C:\Users\mahidhai\cygwin64\usr\sbin
Make sure that the variable is permanently stored. It is not erased after you close the environment variables GUI.
Sometimes you might find it difficult to add a path variable.
Make sure windows is updated.
Even if Windows is updated and you have problems, directly go to the registry and navigate to the below.
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
Add your path here. Remove any unnecessary repetitions of path variables.
Note:
You need to add your path variables in system environment variables -path
enter image description hereIf you just want to run C program but meet this error, it might mean that MinGw c++ compiler has not been installed even if "C:\MinGW\bin" has already been added to Windows Path variable.
Solution:
Run "mingw-get-setup.exe" to open MinGW Installation Manager
Open All Packages->MinGw->MinGW Base System->MinGW Compiler Suite
Select the following compilers to install:
. mingw32-gcc-g++
. mingw32-gcc-v3-core
. mingw32-gcc-vc-g++
Click Installation->Apply Changes to apply the above changes
Wait for the installation finishing(There might be some errors, just ignore them).
Restart Eclipse.
Done.
It Worked in my environment.
Hope it works in your case.

Launch Failed. Binary not found. CDT on Eclipse Helios

I'm using Eclipse Helios on Ubuntu 10.04, and I'm trying to install CDT plugin on it. I download it from here here.
And then I go to Install New Software and select the zip file (I don't extract it, just select the zip file). And its ok, it installs, everything works fine, it shows optional features, blah blah blah.
And then I create a new HelloWorld project. And when I try to run it, it shows an error and says:
Launch failed. Binary not found.
Can anyone explain me how to fix it?
Thanks.
You must build an executable file before you can run it. So if you don't “BUILD” your file, then it will not be able to link and load that object file, and hence it does not have the required binary numbers to execute.
So basically right click on the Project -> Build Project -> Run As Local C/C++ Application should do the trick
First you need to make sure that the project has been built. You can build a project with the hammer icon in the toolbar. You can choose to build either a Debug or Release version. If you cannot build the project then the problem is that you either don't have a compiler installed or that the IDE does not find the compiler.
To see if you have a compiler installed in a Mac you can run the following command from the command line:
g++ --version
If you have it already installed (it gets installed when you install the XCode tools) you can see its location running:
which g++
If you were able to build the project but you still get the "binary not found" message then the issue might be that a default launch configuration is not being created for the project. In that case do this:
Right click project > Run As > Run Configurations... >
Then create a new configuration under the "C/C++ Application" section > Enter the full path to the executable file (the file that was created in the build step and that will exist in either the Debug or Release folder). Your launch configuration should look like this:
Go to the Run->Run Configuration-> now
Under C/C++ Application you will see the name of your executable + Debug (if not, click over C/C++ Application a couple of times). Select the name (in this case projectTitle+Debug).
Under this in main Tab -> C/C++ application -> Search your project -> in binaries select your binary titled by your project....
You must "build" before "run", otherwise "Binary not found". You can set up "Auto build", so that it will build and run. Check this post to set up "Auto build" http://situee.blogspot.com/2012/08/how-to-set-eclipse-cdt-auto-build.html
I had this problem for a long while and I couldn't figure out the answer. I had added all the paths, built everything and pretty much followed what everyone on here had suggested, but no luck.
Finally I read the comments and saw that there were some compilation errors that were aborting the procedure before the binaries and exe file was generated.
Bottom line: Do a code review and make sure that there are no errors in your code because sometimes eclipse will not always catch everything.
If you can run a basic hello world but not your code then obviously something is wrong with your code. I learned the hard way.
If you still have an error even after building the project then try to do this:
click on Binaries in Project Explorer with the left button
click on green "Play" button (Run Debug)
I was having this same problem and found the solution in the anwser to another question:
https://stackoverflow.com/a/1951132/425749
Basically, installing CDT does not install a compiler, and Eclipse's error messages are not explicit about this.
I faced the same problem. I have Eclipse Indigo and Eclipse Luna on Ubuntu. I tried many solutions, but none worked. Here's how you can try :)
Try it in order :)
Either do Build All and then compile :)
Install G++ Compiler
Windows->Preferences->NEW CDT PRoject-> Makefile-> Binary Parsers-> Choose Cywin or Window PE depending on your Os :)
Change your toolchain to cywin gcc
Project->Properties->Environment-> Release Active
After 1,2, 3, and 4, I tried changing paths, and other stuff, but nothing worked. In the end, I noticed that it mentioned Debug Active was not configured. So when I changed it to Release Active, it worked. Do note that change in environment and path is not required.
I faced the same problem while installing Eclipse for c/c++ applications .I downloaded Mingw GCC ,put its bin folder in your path ,used it in toolchains while making new C++ project in Eclipse and build which solved my problem.
Referred to this video
Seems like having "Build Automatically" under the Project menu ought to take care of all of this. It does for Java.
make sure you have GDB installed on your system...
If your using Linux based OS simply in a terminal type:
sudo apt-get install gdt
when finished downloading extract the file and install.
close your IDE (in this case eclipse and open it again and run your project.
Adding the compiler to the PATH fixed the problem for me...
export PATH="$HOME/opt/cross/bin:$PATH"
My problem was the same as one commenter above. I had to change the binary parser to the correct one (PE for windows, ELF for Linux, mach for mac)