I'm using Anjuta for programming C++ right now, but it cannot compile properly at all. When I press "compile" this is the error shown:
make New file 1
make: *** No rule to make target 'New'. Stop.
Can someone please explain what is going on? I've already tried compiling on a lot of different IDEs. D:
Also, I'm just doing the simple "Hello world" program if you were wondering. It doesn't make a difference whether it's complicated or as simple as hell right now though.
Cannot compile any C++ program (Ubuntu)
Started by Decae, Aug 13 2010 12:21 PM
8 replies to this topic
#1
Posted 13 August 2010 - 12:21 PM
|
|
|
#2
Posted 13 August 2010 - 12:36 PM
Did you create a new project for it and save before building? I don't recommend Anjuta among others, make files for a simple project is just plain messy. Ensure the build essentials packages is installed:
sudo apt-get install build-essentialAnd then you can install a more lightweight and simpler IDE such as Geany:
sudo apt-get install geanyIt's almost as lightweight as a text editor, and allows you to build directly the file with a compiler (rather than creating a "project" for each source), simpler IMO.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#3
Posted 13 August 2010 - 12:42 PM
Okay, I installed Geany and everything, but I still cannot compile/run my code. The compile button is faded out, and I can't click on it. (I saved the file first btw)
#4
Posted 13 August 2010 - 12:47 PM
Decae said:
Okay, I installed Geany and everything, but I still cannot compile/run my code. The compile button is faded out, and I can't click on it. (I saved the file first btw)
Are you sure build-essentials is installed? What are in the textboxes in build->set includes and arguments when you're in a .cpp file?
Try running this on your .cpp file as well to ensure you can compile:
g++ ./file.cpp -o ./file && ./fileI'm off to an appointment , so I may not be of help for the next while.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#5
Posted 13 August 2010 - 12:51 PM
I'm sure build-essentials is installed and the "set includes and arguments" is also faded and cannot be selected.
#6
Posted 13 August 2010 - 01:35 PM
Have you tried opening a command prompt and using "g++ file.cpp" on a simple one file program?
#7
Posted 13 August 2010 - 03:56 PM
WingedPanther said:
Have you tried opening a command prompt and using "g++ file.cpp" on a simple one file program?
#8
Posted 13 August 2010 - 04:01 PM
Open up a command prompt (most likely through system->console or something, not aware of gnome's structure) and traverse to the directory where your .cpp file is, such as:
Then type "ls" to ensure your .cpp file is there, if it is, try running:
This will output an executable named "foo" in the current directory, run it in command line by typing:
This will ensure your compiler is installed and actually works.
cd /home/decae/projects/foo
Then type "ls" to ensure your .cpp file is there, if it is, try running:
g++ foo.cpp -o foo
This will output an executable named "foo" in the current directory, run it in command line by typing:
./foo
This will ensure your compiler is installed and actually works.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#9
Posted 13 August 2010 - 05:55 PM
YES, I finally got it to work, thank you very much. I thought it automatically saved to .cpp, but when I put that in, it worked just fine. To think it was that simple...
Thanks again for all your help! ;D
Thanks again for all your help! ;D


Sign In
Create Account

Back to top









