Ursprüngliche Nachricht: Ok, I have an easy question. I compiled my hello.c prog. #include <stdio.h> int main(void) { printf("hello world \n"); return 0; } gcc hello.c -o hello Normaly, I should get an exe file! But when I start it, I get only, that it couldn't found a file. But it's in the dir.. I guess somthing ist wrong with my shell. (bash-2.03) Where is the problem? Thanks Torsten ______________________________________________________________________________ Ferienklick.de - Jede Menge Urlaub auf einen Blick! Hier geht's zu Ihrem Traumstrand: http://ferienklick.de/?PP=2-0-100-105-1
Torsten Becker wrote:
Ursprüngliche Nachricht: Ok, I have an easy question. I compiled my hello.c prog.
#include <stdio.h>
int main(void) { printf("hello world \n"); return 0; }
gcc hello.c -o hello
Normaly, I should get an exe file! But when I start it, I get only, that it couldn't found a file. But it's in the dir.. I guess somthing ist wrong with my shell. (bash-2.03) Where is the problem? Thanks Torsten
______________________________________________________________________________ Ferienklick.de - Jede Menge Urlaub auf einen Blick! Hier geht's zu Ihrem Traumstrand: http://ferienklick.de/?PP=2-0-100-105-1
Look for a file called I believe a.out or something with out in the name. Thats the default output, to launch you need to do a ./a.out Matt
From Matthew to Torsten Becker and suse-linux-e@suse.com about Re: [SLE]...:
Torsten Becker wrote:
Urspr�ngliche Nachricht: Ok, I have an easy question. I compiled my hello.c prog.
#include <stdio.h>
int main(void) { printf("hello world \n"); return 0; }
gcc hello.c -o hello
Normaly, I should get an exe file! But when I start it, I get only, that it couldn't found a file. But it's in the dir.. I guess somthing ist wrong with my shell. (bash-2.03) Where is the problem? Thanks Torsten
______________________________________________________________________________ Ferienklick.de - Jede Menge Urlaub auf einen Blick! Hier geht's zu Ihrem Traumstrand: http://ferienklick.de/?PP=2-0-100-105-1
Look for a file called I believe a.out or something with out in the name. Thats the default output, to launch you need to do a ./a.out
It is the deault but here the program is called hello (-o hello) You should use ./hello
Matt
-- dieter
dieter wrote:
From Matthew to Torsten Becker and suse-linux-e@suse.com about Re: [SLE]...:
Torsten Becker wrote:
Urspr�ngliche Nachricht: Ok, I have an easy question. I compiled my hello.c prog.
#include <stdio.h>
int main(void) { printf("hello world \n"); return 0; }
gcc hello.c -o hello
Normaly, I should get an exe file! But when I start it, I get only, that it couldn't found a file. But it's in the dir.. I guess somthing ist wrong with my shell. (bash-2.03) Where is the problem? Thanks Torsten
______________________________________________________________________________ Ferienklick.de - Jede Menge Urlaub auf einen Blick! Hier geht's zu Ihrem Traumstrand: http://ferienklick.de/?PP=2-0-100-105-1
Look for a file called I believe a.out or something with out in the name. Thats the default output, to launch you need to do a ./a.out
It is the deault but here the program is called hello (-o hello) You should use ./hello
Matt
Goddamn, I am/have lost my mind hehe. Sorry about that, yes indeed in this case it is ./hello. If you really want exe you can do -o hello.exe Matt
On Wed, Jun 06, 2001 at 07:30:01AM +0200, Torsten Becker wrote:
Ursprüngliche Nachricht: Ok, I have an easy question. I compiled my hello.c prog.
#include <stdio.h>
int main(void) { printf("hello world \n"); return 0; }
gcc hello.c -o hello
Normaly, I should get an exe file! But when I start it, I get only, that it couldn't found a file. But it's in the dir.. I guess somthing ist wrong with my shell. (bash-2.03)
It looks like you're doing this as root... root doesn't have the current directory in its path, so to run a file in the current directory you have to use the command './progname' or, in your case, './hello' (no quotes). If you are doing this as root, as I think you are, then DON'T. Create another user and use that account. Using root for everyday work is a Bad Thing. Hope that helps, Chris -- __ _ -o)/ / (_)__ __ ____ __ Chris Reeves /\\ /__/ / _ \/ // /\ \/ / ICQ# 22219005 _\_v __/_/_//_/\_,_/ /_/\_\
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On June 6, 2001 10:08 am, Chris Reeves wrote:
If you are doing this as root, as I think you are, then DON'T. Create another user and use that account. Using root for everyday work is a Bad Thing.
Ah, the one most important point that newbies don't seem to listen to. I was once a young soul logging in as root for regular usage. I thought, "Hey, I know what I'm doing. It's no worse than in DOS." Precisely. As I used it more and more I started realising that I actually want to limit what I can do with the system: dd if=/dev/zero of=/dev/hda ... Aggh, I meant /dev/fd0, /DEV/FD0!!!! Well, ok, I didn't actually do this but it is definitely not inconceivable. Also note that Linux's success in not having viruses lies in the fact that many people do log in with user accounts. Meanwhile, I like how the new KDE builds pop up a dialog when you log in as root. To continue you have to click the "I do not care about my data, let me login" option. Heh heh. - -- James Oakley Engineering - SolutionInc Ltd. joakley@solutioninc.com http://www.solutioninc.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.5 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE7Hi38+FOexA3koIgRAqTWAKCknpX1lT+qn/7/qrOP5WdLqUz55ACfU6Y0 qBc8LPLAmImNYHDc3RCS3LY= =qggi -----END PGP SIGNATURE-----
participants (5)
-
Chris Reeves
-
dieter
-
James Oakley
-
Matthew
-
Torsten Becker