Re: very basic gcc question



try using "g++" instead of "gcc"

"Brian J. Rohan" wrote:
> 
>   I am new to C++, and realize this may not be the best group to post
> C++ questions in (what group would be best?).  I have tried to compile a
> very basic C++ program as follows:
> 
> #include <iostream.h>
> 
> int main()
> {
>   cout <<"Hello World!\n";
>   return 0;
> }
> 
> I then go to the directory contaiing the .cc file above, and type gcc
> ch1proj1.cc (the name of the file)
> I then get the following error messages:
> 
> /tmp/cc2y1g3w.o: IN function `main':
> /tmp/cc2y1g3w.o(.text+0xf): undefined reference to `cout'
> /tmp/cc2y1g3w.0(.text+0xf): undefined reference to
> `ostream::operator<<(char const *)'
> collect2: ld returned 1 exit status
> 

> What is wrong?? i am using RedHat7.0, I recently upgraded form 6.2
> 
> Thank you very much
> 
> Brian
> 
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]