Unix Technical Forum

Ubuntu 6.10: I cannot compile "hello world"

This is a discussion on Ubuntu 6.10: I cannot compile "hello world" within the Linux Operating System forums, part of the Unix Operating Systems category; --> Hallo everybody, I gave ubuntu 6.10 a try as a live system. while gcc is there, I was NOT ...


Go Back   Unix Technical Forum > Unix Operating Systems > Linux Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-19-2008, 07:03 AM
Luciano
 
Posts: n/a
Default Ubuntu 6.10: I cannot compile "hello world"

Hallo everybody,

I gave ubuntu 6.10 a try as a live system.
while gcc is there, I was NOT able to run the "hello world"
example: either stdio.h or printf or both don't seem to work
out of the box. Why?
How can I fix the bug (I don't think it is a feature)

Thanks
Luciano

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-19-2008, 07:03 AM
Rich Gibbs
 
Posts: n/a
Default Re: Ubuntu 6.10: I cannot compile "hello world"

Luciano said the following, on 05/10/2007 11:27 AM:
> Hallo everybody,
>
> I gave ubuntu 6.10 a try as a live system.
> while gcc is there, I was NOT able to run the "hello world"
> example: either stdio.h or printf or both don't seem to work
> out of the box. Why?
> How can I fix the bug (I don't think it is a feature)
>


Your subject says, "cannot compile ...". The body of your message says,
"I was NOT able to run ...", You don't give your program, any error
messages, or any description of what happens when it doesn't "seem to work".

How on earth do you expect anyone to help you if you don't tell us what
the problem is? Post your program and the output you get when you
compile it and try to run it.


--
Rich Gibbs
richg74@gmail.com
"You can observe a lot by watching." -- Yogi Berra

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-19-2008, 07:03 AM
Bill Marcum
 
Posts: n/a
Default Re: Ubuntu 6.10: I cannot compile "hello world"

On Thu, 10 May 2007 17:27:47 +0200, Luciano
<nhbfluci@rrzn-user.uni-hannover.de> wrote:
>
>
> Hallo everybody,
>
> I gave ubuntu 6.10 a try as a live system.
> while gcc is there, I was NOT able to run the "hello world"
> example: either stdio.h or printf or both don't seem to work
> out of the box. Why?
> How can I fix the bug (I don't think it is a feature)
>

sudo aptitude install build-essential


--
"Don't fear the pen. When in doubt, draw a pretty picture."
-- Baker's Third Law of Design.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-19-2008, 07:03 AM
The Ghost In The Machine
 
Posts: n/a
Default Re: Ubuntu 6.10: I cannot compile "hello world"

In comp.os.linux.setup, Luciano
<nhbfluci@rrzn-user.uni-hannover.de>
wrote
on Thu, 10 May 2007 17:27:47 +0200
<Pine.GSO.4.44.0705101725450.2280-100000@unics>:
> Hallo everybody,
>
> I gave ubuntu 6.10 a try as a live system.
> while gcc is there, I was NOT able to run the "hello world"
> example: either stdio.h or printf or both don't seem to work
> out of the box. Why?
> How can I fix the bug (I don't think it is a feature)
>
> Thanks
> Luciano
>


Well, first off, you didn't exactly give lots of detail as to error
messages -- or for that matter, your "Hello world" program.

Here's a "hello world"; it's about as simple as hello world gets. :-)

-----8< >8------
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Hello, world!\n");
return 0;
}
-----8< >8------

Put this in hello.c and then compile it:

$ gcc hello.c -o hello
$ ./hello

If the -o is omitted, gcc (actually, the linker ld;
gcc delegates :-) ) creates a file named (for rather
traditional reasons) "a.out".

Also, the PATH variable almost never contains the current
directory (putting '.' in PATH is a bad idea, as malicious
spoofsters can have a field day putting, say, "ls" in
there that does naughty or nasty things); hence the "./"
in "./hello", to hint to the shell that it needs to use
the current directory.

If you're still having problems, you'll need to tell
us what error messages gcc or ./hello is generating.
At least that way we'll have something to go on.

--
#191, ewill3@earthlink.net
Linux. The choice of a GNU generation.
Windows. The choice of a bunch of people who like very weird behavior on
a regular basis, random crashes, and "extend, embrace, and extinguish".

--
Posted via a free Usenet account from http://www.teranews.com

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-19-2008, 07:03 AM
Luciano
 
Posts: n/a
Default Re: Ubuntu 6.10: I cannot compile "hello world"

On Fri, 11 May 2007, Bill Marcum wrote:

> On Thu, 10 May 2007 17:27:47 +0200, Luciano
> <nhbfluci@rrzn-user.uni-hannover.de> wrote:
> >
> >
> > Hallo everybody,
> >
> > I gave ubuntu 6.10 a try as a live system.
> > while gcc is there, I was NOT able to run the "hello world"
> > example: either stdio.h or printf or both don't seem to work
> > out of the box. Why?
> > How can I fix the bug (I don't think it is a feature)
> >

> sudo aptitude install build-essential
>

Thanks!
you enabled the "crystal ball" option,
understood what i meant
and gave me the solution
(or at least something very well worth trying)

Thanks again
Luciano :-)

> --
> "Don't fear the pen. When in doubt, draw a pretty picture."
> -- Baker's Third Law of Design.
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:16 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com