Compile C++ file

Questions about applications and software
Forum rules
Before you post please read how to get help
captain_juno
Level 1
Level 1
Posts: 43
Joined: Sun Feb 03, 2008 5:49 pm
Location: KY USA

Compile C++ file

Postby captain_juno » Sun Apr 12, 2009 11:56 pm

I wrote a little program in c++ with codeblocks but I'm unsure how to compile it. I'm pretty sure there's a way to do it from the command line (gpp <the filename>) but I'm not for sure. I tried doing the command I stated but it said the program was not installed. Is there a program that already is installed?

User avatar
grimdestripador
Level 6
Level 6
Posts: 1057
Joined: Fri Feb 16, 2007 2:26 am

Re: Compile C++ file

Postby grimdestripador » Mon Apr 13, 2009 1:08 am

first sudo apt-get install build-essential

gcc appsource.cpp
the file will appear as a.out, you can run it by typing ./a.out

if you want to name the file
gcc appsource.cpp -o app

this file would be run ./app


Return to “Software & Applications”

Who is online

Users browsing this forum: LongdistanceSwimmer and 17 guests