Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am new to this mess

Status
Not open for further replies.

italy

Programmer
Feb 13, 2001
162
US
Hi guys I am trying to compile and run my first c program in redhat and I am compiling it and the output fine but I want to run by double clicking no success and from terminal it says there is no command with this name how can I run this program and if there is any tips for compiling and running I really approciated and by the way what is the extention of the executable file on redhat
 
in linux programs are executable if they are set to be executable using chmod (type "man chmod" to learn more).

For example if you want everyone to be able to execute a file you could do :

$ chmod 777 fileName

and then you could do this to execute the file :

$ fileName

Contrarily to Windows the extension doesn't mean anything to the OS.

Gary Haran
********************************
 
thks for u r response but I did change the mode and I know aobut the file permission but did not and I am logging with root permession but no luck every time I put the program name it says there s no command name
 
try :

$ ./fileName

When you are in the actual folder with the item or the full path of the item :

$ /etc/bin/fileName

Good luck! :)

Gary Haran
********************************
 
thks very much it works if you dont mind guys also I need your advise what tool should I use to compile and debugg especially I will work on linux environment and also more clear debugging tool I find it defecault to debug in linux environment not like windows in borland u now what I mean?
great thanks in advance
 
to compile most people use gcc (man gcc to learn more).

I don't know of any IDE's or anything that could help out though I am certain there are some in the realm of existance! :)

Gary Haran
********************************
 
I know gcc but I mean what is the common practice to use for editor like emacs or vim and also what switches r there for the gcc compiler that I can use to make my debugging easier and more informal I tried to use man but was not clear thanks
 
I do not have access to my linux box right now but I do believe that make and gcc commands are what you should look into.

To check out the flags you can use for each of them you can use :

$ man make
$ man gcc

I hope this helps.

Gary Haran
********************************
 
The debugger for gcc is gdb: man gdb.
Install it if you don't have it installed already.

Do a google search for gdb frontends.
Kdbg for the K desktop environment is decent.

I usually don't use debuggers for my own development but
for other peoples code they are very helpful.

 
For me I use vim to write my code.

If you add the -g option to gcc it will be easier to debug your code (adds source code to prog to allow line by line debug).

For debug I use ddd. It interfaces with gdb but gives it a graphical frontend that makes it easier to set break points and to see the call graph for the program.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top