LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 04-12-2004, 05:41 AM   #1
vtluu
LQ Newbie
 
Registered: Mar 2004
Location: Vietnam
Posts: 9

Rep: Reputation: 0
How can I use gcc to build a static library?


How can I use gcc to build a static library (.a)? What is the difference between gcc and g++ (as C++ compilers)?

Many thanks for your help.

Luu Vo.
 
Old 04-12-2004, 10:45 AM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Mineral, Virginia
Distribution: Debian 8
Posts: 7,875

Rep: Reputation: 318Reputation: 318Reputation: 318Reputation: 318
"How can I use gcc to build a static library (.a)?"

Pass gcc the -static option. See:
man gcc

" What is the difference between gcc and g++ (as C++ compilers)?"

Use gcc to compile programswritten in C. Use g++ to compile programs written in C++. I think that recently GNU dropped the distinction and both compilers will compile either C or C++ but I am not sure of that.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites
 
  


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
shared to static library ofada Programming 2 07-08-2009 11:54 AM
static qt library in debian dun_noe Debian 2 05-23-2005 02:42 AM
howto compile bin with my library using all-static and shared linked standart library stpg Programming 4 06-29-2004 04:20 AM
static linking to c library lantern Programming 1 04-19-2004 08:58 AM
How to use own static library? chuanyung Programming 4 03-10-2004 07:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 06:13 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