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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| 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 |
| |||
| 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. |
| |||
| 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 |
| ||||
| 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. > |