Hint #1: gcc is for compiling C programs; for C++ use g++
Hint #2: Read a few books on the subject...
This is a discussion on having trouble compiling and running w/ linux - Help ; Hello, I am running RH8 with my Grub kernel. I am trying to compile a simple hello world program in C++ to be compiled and ran and am not sure if I am doint it right. I looked in various ...
Hello,
I am running RH8 with my Grub kernel. I am trying to compile a simple hello
world program in C++ to be compiled and ran and am not sure if I am doint
it right.
I looked in various places for this info to do correctly.
One result was to issue the command:
gcc -o helloworld helloworld.cpp
didn't work
I searched further only to find that I need to link this to an object file
that needs to be created in order for the program to execute properly.
gcc -o helloworld helloworld.o
and then to execute
gcc -o helloworld helloworld.cpp
With this procedure implemented, I get an error, don't remember exactly;
however there are many errors that pertain to each file in the process of
compile that generate the same " extra dependancy to "*.*" and I get no
further results.
I then tried the makefile option to execute the make command at the terminal
prompt.
my makefile looked like this;
helloworld: helloworld.cc
gcc -o helloworld helloworld.cc
did I have the wrong extensions here in my make file?
i was told by this method that no directives are included with the makefile.
do I only have partially correct all of these procedures?
What do I need to do to compile a program?
Thanks
KW
Hint #1: gcc is for compiling C programs; for C++ use g++
Hint #2: Read a few books on the subject...
"kw"wrote in message news: ...
> Hello,
>
> I am running RH8 with my Grub kernel. I am trying to compile a simple hello
> world program in C++ to be compiled and ran and am not sure if I am doint
> it right.
Have you tried looking for the answer using an internet search engine?
http://freebooks.by.ru/view/RedHatLi...d/rhl6u301.htm
Another good idea would be to pop into your local computer bookshop?