PDA

View Full Version : Run directory program in ubuntu



sanda199
January 2nd, 2013, 03:28 AM
Hi everyone, I wanna run c++ program in ubuntu terminal. But my program in under some directory. So how can i run it? thanks

sanda199
January 2nd, 2013, 03:30 AM
I also don't know how to compile it. Pls help me. Thanks

fdrake
January 2nd, 2013, 03:45 AM
I also don't know how to compile it. Pls help me. Thanks



#install the complier
sudo aptitude install build-essential g++
# to compile
g++ -o complied not_compiled.cpp
#to run
./compiled

google the ne you will find plenty of FAQ and help!

sanda199
January 2nd, 2013, 04:00 AM
but my program is within directory. Is it the same way to compile and run? thanks

PaulM1985
January 2nd, 2013, 12:21 PM
Slightly modifying fdrake's post:



#install the complier
sudo aptitude install build-essential g++
# to compile
g++ -o your_dir/complied your_dir/not_compiled.cpp
#to run
./your_dir/compiled


Paul