Getting my existing c++ programs to work with the g++ compiler
Hi, I'm a newbie :)
I'd like to know how to modify my existing c++ files to work with the g++/gcc compiler. I jus got linux red hat 9.0 (shrike) and every time i try to run my programs nothing happens. example i just learned that how to use the cin and cout statements with g++ (i used Turbo C++ on my windows machine), so i have this file "helloworld.cpp" that i made to test out g++ and it has: Code:
#include <iostream> //iostream.h deprecated i'd really like to why this is and/or what i'm doing wrong :confused: |
a.out is the default output file , you can run it in the follow ways:
1) cd to the dir where it is at, then type ./a.out 2) use its whole path, e.g /home/you/where_the_file_is/a.out |
You can give a name for the executable like this:
Code:
g++ -o helloworld helloworld.cpp Code:
g++ -Wall -o helloworld helloworld.cpp Code:
CXX = g++ Once you do this, you can just type Code:
make |
Thanx Alot! :D
|
All times are GMT -5. The time now is 12:06 PM. |