Click to See Complete Forum and Search --> : C++


Magnus_Lei
08-17-2001, 04:37 PM
I am trying to learn to program on linux and i go to run the command (g++ HELLO.C++ -o hello) and it says the command is not there. So, i am asuming that i need to install the g++ compiler...could someone explain how this is done. :confused:

Stuka
08-17-2001, 04:50 PM
Most Linux distros have a C++ development package. Install the appropriate one for your system (it should be on the installation disks if you have them), make sure you've included any necessary development packages you're going to use (Qt, GTK, GNOME, etc.), and you should be ready to go.

Malakin
08-17-2001, 05:25 PM
To elaborate a little, the files you need on your install cd's will (probably) be gcc-2.9* and gcc-c++*, this will create an executable in your /usr/bin/ called something that starts with g++, so it could be g++-2.96 and then you can make a link to g++ like "ln g++-2.96 g++", then if you type (g++ HELLO.C++ -o hello) it should work unless I'm forgetting something :)

Magnus_Lei
08-20-2001, 02:20 PM
Ok i now have installed gcc-c++ on to my computer along with libstdc++. When i run g++ hello.c++ -o hello, It compiles the program and gives me an executable. but when i go to the terminal and type in hello. It says hello command not found. Why is this? I have also tried clicking on it from the gui and it doesn't do anything.

anton
08-20-2001, 02:28 PM
I even might be able to help you here ;)

type not just "hello" , but "./hello" , b/c u want to execute it from current directory

Magnus_Lei
08-20-2001, 02:35 PM
That's it thanks!!!!

Mr.Shifty
08-20-2001, 08:57 PM
i am currently using Gcc one thing i noticed maybe a fluke but...

if your source is HELLO.cxx and in the command after -o u typed:hello
it compiles and gives you a exe but i would have to type /hello

however if i did HELLO at the end of -o all i had to type was HELLO after compile
fluke?

[ 20 August 2001: Message edited by: Mr.Shifty ]