Compile C++ file

Questions about applications and software
Forum rules
Before you post please read how to get help

Compile C++ file

Postby captain_juno on 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?
Level 1
Level 1
Posts: 43
Joined: Sun Feb 03, 2008 5:49 pm
Location: KY USA

Linux Mint is funded by ads and donations.

Re: Compile C++ file

Postby grimdestripador on 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
User avatar
Level 6
Level 6
Posts: 1060
Joined: Fri Feb 16, 2007 2:26 am

Return to Software & Applications

Who is online

Users browsing this forum: Google [Bot], jjott and 11 guests