Mailinglist Archive: opensuse (3983 mails)
| < Previous | Next > |
Re: [SLE] C Programming in SuSE
- From: Jerry Feldman <gaf@xxxxxxx>
- Date: Tue, 16 Dec 2003 21:01:23 -0500
- Message-id: <20031216210123.390165fd.gaf@xxxxxxx>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tue, 16 Dec 2003 15:32:10 EST
KPP52@xxxxxxx wrote:
> I have Personal 9.0
> I wrote the basic C program first.c
> then I did: gcc -o first first.c
> then I tried to run it by typing: first
> and it gives me a message: bash first no such command.
> so I tried: gcc first.c
> there was an a.out file in the directory
> then I typed: a.out
> and it gives me the same error message.
> Is there something I'm missing with the C compiler here?
> I'm new to SuSE and new to linux in general. I have done some C
> programming in Unix and this is confusing me tremendously. Any help
> would be greatly appreciated.
>
Let me add some clarifications to some of the postings on this. I think
that Gary gave the correct answer:
gcc -o first first.c
This creates the file, first, with the correct executable permissions.
gcc first.c
This creates a.out with the correct executable permissions.
As Gary mentioned, by default SuSE (and nearly every other Linux and
Unix system) does not include the current directory in your PATH
environment variable for security reasons. For this reason, you must use
either absolute or relative path to execute files that are not in your
PATH. For this reason, to execute anything in your current directory,
you must use the relative path (eg. ./<name of file> ) or the full path
(eg. /home/yourusername/<path to current directory>/<filename>).
So to execute first:
./first
or to execute a.out:
./a,out
- --
Jerry Feldman <gaf@xxxxxxx>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)
iD8DBQE/37jz+wA+1cUGHqkRAjzSAJ0bYcV09uCoGQSsKiivq4X7q8BSXACcCaEi
KvO3Gwa4YJ9wVwfZNtpmroc=
=EyXP
-----END PGP SIGNATURE-----
Hash: SHA1
On Tue, 16 Dec 2003 15:32:10 EST
KPP52@xxxxxxx wrote:
> I have Personal 9.0
> I wrote the basic C program first.c
> then I did: gcc -o first first.c
> then I tried to run it by typing: first
> and it gives me a message: bash first no such command.
> so I tried: gcc first.c
> there was an a.out file in the directory
> then I typed: a.out
> and it gives me the same error message.
> Is there something I'm missing with the C compiler here?
> I'm new to SuSE and new to linux in general. I have done some C
> programming in Unix and this is confusing me tremendously. Any help
> would be greatly appreciated.
>
Let me add some clarifications to some of the postings on this. I think
that Gary gave the correct answer:
gcc -o first first.c
This creates the file, first, with the correct executable permissions.
gcc first.c
This creates a.out with the correct executable permissions.
As Gary mentioned, by default SuSE (and nearly every other Linux and
Unix system) does not include the current directory in your PATH
environment variable for security reasons. For this reason, you must use
either absolute or relative path to execute files that are not in your
PATH. For this reason, to execute anything in your current directory,
you must use the relative path (eg. ./<name of file> ) or the full path
(eg. /home/yourusername/<path to current directory>/<filename>).
So to execute first:
./first
or to execute a.out:
./a,out
- --
Jerry Feldman <gaf@xxxxxxx>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)
iD8DBQE/37jz+wA+1cUGHqkRAjzSAJ0bYcV09uCoGQSsKiivq4X7q8BSXACcCaEi
KvO3Gwa4YJ9wVwfZNtpmroc=
=EyXP
-----END PGP SIGNATURE-----
| < Previous | Next > |