PDA

View Full Version : C++ compiled files are not executing



Wechuks
June 7th, 2007, 01:02 PM
It happens with all compiled files, when I compile any source code all is ok, but when itry to run it , nothing happens
exaple of code

#include <iostream>

int main()
{
std::cout << "Hello World\n";
}

I am using Anjuta 1.2.4a
Why it is happening?

badactress
June 7th, 2007, 01:15 PM
I'm not sure if just compiling the code in Ajunta creates an executable.. What happens if you 'build' the project (in same menu as 'compile') instead of just compiling? This should create a finished executable file that will run ok..

Wechuks
June 7th, 2007, 02:09 PM
I Am using build and it creates executable , but it isnt working

slavik
June 7th, 2007, 04:11 PM
how do you run the binary?

anjuta doesn't run the binaries as soon as it creates them ;)

Biased turkey
June 8th, 2007, 01:13 AM
After you created the project with Anjuta, do the 3 following steps:
Build -> Auto Generate
Build -> Build All
Build -> Execute

jfinkels
June 8th, 2007, 01:16 AM
You could try to compile and run it from the terminal to see if that's working:
g++ -o outputfile source.cpp
./outputfile