NetBeans 7.0.1 good C++ program execution "RUN FAILED" - c++

Working inside NetBeans 7.0.1, fresh install on Ubuntu 13.10.
I have a known good C++ program.
I finally get it to compile and link.
When I press the Netbeans Run Main Project triangle, the execution breaks with
java.util.MissingResourceException: bin/nativeexecution/Linux-x86/pty
RUN FAILED
What's going on, and how to fix it?

This is a NetBeans output-window setting problem.
NetBeans comes up with C++ projects defaulting to "Internal Terminal". This is not working on your present configuration.
The answer is to switch your output to "External Terminal", which pops up a separate purple terminal typing console in its own window for your interaction, or "Standard Output",which presents the output in the expected white subpane below.
Do this by:
Right-mouse-click on your project name -> Properties
on the left side, in the "Categories:" column, select * Run
on the right side, beside the >General -> Console Type:,
change the pulldown menu from "Internal Menu" into "Standard Output".
Hit the OK button at the bottom to lock it in.
Now your project will run, forever after, when you ask it to.

according to this netbeans forum post package of netbeans 7.0.1 is lacking some files.
Removing version from repo and installing from netbeans download site worked like a charm for me and nb forum OP.
So problem is also in ubuntu 14.04.
Also repo version is little out-of-date and NB have nice .sh installer. Just remember to install some JDK from repo or anywhere else.

Related

Why I added g++ to PATH but failed compiling C++ code in atom?

I am a new C++ developer and I recently installed the Atom editor due to recommendations. I used Code::blocks before, but it happened to have no debuggers. I installed the gpp-compiler extension. I also installed MinGW via the installation manager and added it to PATH. I opened Atom and right-clicked on the file I desired to execute, then clicked on the "Compile and run" option presented on the panel that popped out. Below is a screenshot:
Click here to view.
After clicking on the option, I discovered that an error popped out (also shown in the screenshot above) that roughly says my g++ isn't installed in PATH. I viewed some websites that displayed the method of how to check MinGW's existence in PATH. The website showed the following method:
Open command line interface.
Type g++.
Screenshot of the result is shown below.
Click here to view.
The above process essentially shows success.
However, the error still pops out.
Can anyone tell me why is that?
Is MinGW the same as G++?
Is my installation process wrong (I installed the packages manager on mingw.org)?

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.

Juno CDT plugin failing to run a C++ application

I have a simple mixed C/C++ application (OpenGL example) which I have successfully built using Eclipse CDT in Juno (MinGW toolchain).
I can run this application fine by hand from a Win7 command console, but it seems to rarely work when running from Eclipse's "Run as" menu. Whether it works or not seems down to seemingly unrelated changes in the code, and I get nothing of interest on the Eclipse run console (just a <terminated> status) even when no code near the start of the application has changed.
I'd like to and it sometimes I can work around this for now, but would be good to get this working if anyone has any ideas - it seems an essential stepping stone to get the debug environment working in Eclipse.
EDIT Side thought - eclipse seems awfully thin on debug diagnostics when something like this fails. If there is any way to turn on more debug I'd welcome the knowledge =)
Resolved - the issue is down to the path being given to the application, or more specifically the OS launcher (so it can find the DLLs it needs).
Even through the default "run" config claims to inherit the parent environment, it doesn't seem to get the same environment as the Win7 command console. I had to manually edit the "Run as" config in Eclipse to have a custom PATH environment variable containing the directories I needed (MinGW/bin, and a directory containing some custom DLLs).
Cheers, Iso

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

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:

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)