LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-21-2002, 12:32 AM   #1
gurpreetpall
LQ Newbie
 
Registered: Mar 2002
Posts: 5

Rep: Reputation: 0
Question want to run my C program........


i wanted to run my C client server program in linux,
and wanted to see the output of my program which is the tool for linking , please help
thank u
 
Old 03-21-2002, 01:12 AM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
You can do may things with output: send it to screen, to file (logs) etc. What you'd like to do exactly?
 
Old 03-21-2002, 01:18 AM   #3
gurpreetpall
LQ Newbie
 
Registered: Mar 2002
Posts: 5

Original Poster
Rep: Reputation: 0
Question linking tool

which is the tool to link and run C programs in linux
 
Old 03-21-2002, 04:33 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
there is no command to run a c program... it's a program... as for linking, gcc suits me fine. check the manpage.
 
Old 03-22-2002, 03:04 PM   #5
kervin
Member
 
Registered: Jan 2002
Location: Melbourne, FL.
Distribution: redhat
Posts: 168

Rep: Reputation: 31
The tool for linking is 'ld'. Try 'man ld' for the arguements the ld linker takes.

when you call gcc to compile, it automatically calls the linker for you with the suitable arguments.

For example if you have object files, you made by eg. 'gcc -c'. And you'd like to link them, you can call 'gcc file1.o file2.o ...'. or you can call 'ld file1.o file2.o'. The difference is that gcc will include the correct system libraries etc for you in the linking, while ld will just create an invalid executable or throw an error. To see exactly what gcc is doing pass it the '-v' option. You will see all the steps gcc does. eg. 'gcc -v helloworld.c' You will see it compile to assembly, then assemble to objects using the 'as' command, then link using 'ld'

gcc is the GNU C compiler and is found at http://gcc.gnu.org/
ld is part of the 'binutils' package and its homepage is http://sources.redhat.com/binutils/

Your computer may or may not have gcc installed. type 'gcc -v" on the command line to fine out. If not you will have to install from the CD or the website.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
run my program alaios Linux - General 6 07-29-2004 05:27 PM
Program to run mfo6463 Linux - Newbie 2 04-21-2004 07:28 PM
Viewing program messages when program isn't run from command line? Locura Linux - Software 1 09-27-2003 08:19 AM
How do I run a program? rtstar Linux - Newbie 2 07-25-2003 09:08 AM
how to run program? newbe45 Linux - Newbie 31 07-24-2003 09:49 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration