LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Compiling on Ubuntu (http://www.linuxquestions.org/questions/linux-newbie-8/compiling-on-ubuntu-718351/)

Susko80 04-10-2009 10:29 PM

Compiling on Ubuntu
 
I'm new with Linux and I tried the "Hello World!" program, but i cannot compile it. My friend tried explaining it to me over the phone but all i got was "G++ file.cc -o" and i dont know what goes after that and i dont even know if that is right.
My file looks like this.. but i dont know if this is relevant

// my first program in C++
#include <iostream>
using namespace std;
int main ()
{
cout <<"Hello World!";
return 0;
}

amani 04-10-2009 10:35 PM

One nice way of knowing the development tools is by reading the description in synaptic.

What are the c++ and c compilers called?

install kdevelop

AlucardZero 04-10-2009 11:19 PM

g++ file.c -o file.out
./file.out

if you don't have g++/gcc/make/etc, install the build-essentials package via Synaptic

knudfl 04-11-2009 02:40 AM

  • sudo apt-get install build-essential
will provide 'gcc' and 'g++' and then some more, you need for compiling.
( Remember : only two s's in build-essential ! )


All times are GMT -5. The time now is 07:55 AM.