a very basic question regarding gcc...


 
Thread Tools Search this Thread
Top Forums Programming a very basic question regarding gcc...
# 1  
Old 09-04-2006
a very basic question regarding gcc...

hi,
as the topic says.. i`m a newbie to the unix platform.. plz help me out here.
i create a .c file using "vi prog.c"
then write the code in it... then save n exit..
wat happend after tht.. ?? how do i compile n check the program???? i`ve been thru the manual pages of gcc but i cudn`t get anything.. anything i shud know specifically..?

thanx
# 2  
Old 09-04-2006
Computer

hi,
ok ..got the respobnse to my question.. i had to use "./" b4 the output filename... fine.. now one more other doubt...

we have to run the output file using ./a.out (where a.out is the compiled, n linked file) .. now how can i run a.out without using "./" b4 the filename???

thanx
# 3  
Old 09-04-2006
For that you have to include the pwd in the path. You can do that by running
Code:
PATH=$PATH:.; export PATH

in the sh/ksh/bash family of shells. Remember though, this is considered to be very insecure (especially if you are running as root).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

A basic question of regex

Hi, I have a lot of files which begin with the letter x: xab xac xad xae ... I want to join all file with cat, i do cat x* > file My question is, by instinct i thank use cat x.* > file for join all file but don't work, why ? (8 Replies)
Discussion started by: protocomm
8 Replies

2. Programming

A question regarding the gcc compiler ...

It might be a simple one but I have this question bothering me for sometime. When we do a symbol search inside the library directory (i.e. /usr/lib/*) via tools like nm; it takes a while to give us the results. However, its very quick when gcc is invoked to compile a program with the very same... (11 Replies)
Discussion started by: Praveen_218
11 Replies

3. Shell Programming and Scripting

basic nc question

i'm doing this in one terminal: nc -lu 7402 and it appears to start listening properly, then in another i do this: echo "hello" | nc -u localhost 7402 and nothing happens on the listening terminal - what am i doing wrong? thanks. (7 Replies)
Discussion started by: peterworth
7 Replies

4. Shell Programming and Scripting

basic question

hi, I have a basic question,, i am in a directory called /intas/OCU_3.9.1/sbin ocuut1@france>mv itsa_tcs itsa_tcs_old mv: itsa_tcs_old: rename: Permission denied i am logging as the owner of the file. when i am doing this i am getting the above error of permission denied. I know... (3 Replies)
Discussion started by: namishtiwari
3 Replies

5. Shell Programming and Scripting

gcc question

Hi, I am trying to compile a .c file but in the pre-processor directives I want to include a file that I have put together myself (#include "file.h"). How can I accomplish this? (3 Replies)
Discussion started by: sanchopansa
3 Replies

6. HP-UX

Basic OS question

Could someone tell me the command to find out the OS version which will give 12 character not the 9 characters(which is usually machine id). uname -i gives machine id and uname -a is more comprehensive way to look. Thanks! (4 Replies)
Discussion started by: catwomen
4 Replies

7. UNIX for Dummies Questions & Answers

Really basic question....

Hello all. Let me start off by saying I know a little more then it seems by me asking this question... here goes I have an old 486 box and I want to start messing around with unix. I've been taking classes for 3 or 4 years in c programming in unix, so I am used to the commands and such, but I... (1 Reply)
Discussion started by: robherms
1 Replies

8. UNIX for Dummies Questions & Answers

Very Basic Question

How to know if my AIX 5.2 is running at 64bits? THANKS (5 Replies)
Discussion started by: GermanSkull
5 Replies

9. UNIX for Dummies Questions & Answers

basic question

hey...when i type who...what does "pts" field mean??? eg pts 0 etc (1 Reply)
Discussion started by: urwannabefriend
1 Replies

10. UNIX for Dummies Questions & Answers

basic question

I have some basic doubts. Can someone clarify in this forum? 1)if then eval ' tset -s -Q -m ':?hp' ' else eval ' tset -s -Q ' what does it exactly mean in .profile? 2) what are 'nobody' and 'noaccess' usernames in /etc/passwd file. ... (3 Replies)
Discussion started by: asutoshch
3 Replies
Login or Register to Ask a Question