Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > error running hello world

Reply
Thread Tools

error running hello world

 
 
Gary Wessle
Guest
Posts: n/a
 
      07-19-2006
thanks for helping with this problem

I am getting errors starting with

fred@debian:~/myPrograms/cpp/practice$ make
cc hello.cpp
/tmp/ccQzQfGH.o: In function `main':
hello.cpp.text+0x27): undefined reference to `std::cout'

**************** the program ****************
#include <iostream>
using namespace std;

int main() {
cout << "Hello, World! I am "
<< 8 << " Today!" << endl;
return 0;
}
************************************************

**************** the make file ****************
hello: hello.o
cc hello.cpp
***********************************************
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      07-19-2006
Gary Wessle wrote:
> thanks for helping with this problem
>
> I am getting errors starting with
>
> fred@debian:~/myPrograms/cpp/practice$ make
> cc hello.cpp
> /tmp/ccQzQfGH.o: In function `main':
> hello.cpp.text+0x27): undefined reference to `std::cout'
>

Try compiling it with a C++ compiler rather an a C compiler.

--
Ian Collins.
 
Reply With Quote
 
 
 
 
Gary Wessle
Guest
Posts: n/a
 
      07-19-2006
Ian Collins <(E-Mail Removed)> writes:

> Gary Wessle wrote:
> > thanks for helping with this problem
> >
> > I am getting errors starting with
> >
> > fred@debian:~/myPrograms/cpp/practice$ make
> > cc hello.cpp
> > /tmp/ccQzQfGH.o: In function `main':
> > hello.cpp.text+0x27): undefined reference to `std::cout'
> >

> Try compiling it with a C++ compiler rather an a C compiler.
>
> --
> Ian Collins.


thanks
it now compiles but when I run it

************************************************** **************
fred@debian:~/myPrograms/cpp/practice$ ls
a.out hello.cpp hello.o makefile semantic.cache
fred@debian:~/myPrograms/cpp/practice$ a.out
bash: a.out: command not found
************************************************** **************
 
Reply With Quote
 
Thomas J. Gritzan
Guest
Posts: n/a
 
      07-19-2006
Gary Wessle schrieb:
> Ian Collins <(E-Mail Removed)> writes:
>
>> Gary Wessle wrote:
>>> thanks for helping with this problem
>>>
>>> I am getting errors starting with
>>>
>>> fred@debian:~/myPrograms/cpp/practice$ make
>>> cc hello.cpp
>>> /tmp/ccQzQfGH.o: In function `main':
>>> hello.cpp.text+0x27): undefined reference to `std::cout'
>>>

>> Try compiling it with a C++ compiler rather an a C compiler.
>>
>> --
>> Ian Collins.

>
> thanks
> it now compiles but when I run it
>
> ************************************************** **************
> fred@debian:~/myPrograms/cpp/practice$ ls
> a.out hello.cpp hello.o makefile semantic.cache
> fred@debian:~/myPrograms/cpp/practice$ a.out
> bash: a.out: command not found
> ************************************************** **************


The current directory (called ".") is not in your path.

Try:
../a.out

Well, tools and operation systems are offtopic here.
You need to read a good book about Linux.

--
Thomas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
regular expression to parse {"hello", "hello world","1hello-2*hello"} Roy Java 6 01-07-2008 08:06 PM
to print in the reverse order, ("Hello World" -> "World Hello") vijay C Programming 8 04-26-2005 02:11 AM
The world's shortest 'Hello World!' program: a proposal Larry Perl Misc 27 01-25-2005 07:53 PM



Advertisments