Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 04-20-2005, 06:05 AM   #1
LQ Newbie
Registered: Mar 2005
Location: india
Posts: 12

Rep: Reputation: 0
compiling and linking C programs

can anyone please tell me how to compile a C program and link to a library which is created by user.
Old 04-20-2005, 06:19 AM   #2
Registered: Aug 2004
Location: Australia
Distribution: Fedora
Posts: 282

Rep: Reputation: 30
To compile, try
gcc -c <target.cpp> -o <target.o>
To link,
ld -o <output> <target1.o> <target2.o>
use man to find out more about their command switches
Old 04-20-2005, 11:47 AM   #3
Registered: Apr 2004
Posts: 33

Rep: Reputation: 15
Compile: gcc -o xxx file.c
Run: ./xxx


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking Programs to the commandline BorgKiller Linux - Software 2 04-05-2005 09:10 PM
linking C++ programs in FreeBSD balasaravanan *BSD 2 11-03-2004 07:36 PM
Question about linking programs Darx Linux - Newbie 5 05-27-2004 06:17 AM
Linking to programs Ben Sytko Linux - Newbie 3 02-26-2003 06:28 PM
compiling and linking boku Programming 5 12-25-2002 09:23 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:16 PM.

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