LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 06-30-2004, 04:52 AM   #1
ashwinipahuja
Member
 
Registered: Mar 2004
Posts: 79

Rep: Reputation: 15
Creating Libraries in g++


Creating Libraries in g++
Hi ,
I have lots of .cpp files.
i have compiled them suceesfully using g++ compiler.
Now i have lots of .o files.
I want to link these files and convert them into a library.
How to do it
Ash
 
Old 06-30-2004, 05:50 AM   #2
rshinoy
LQ Newbie
 
Registered: May 2004
Posts: 10

Rep: Reputation: 0
Hi ,
You can do it in the following way

g++ $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)

where $(OBJS) are your several objectfiles
------------
regards
rshinoy
 
Old 06-30-2004, 05:53 AM   #3
rshinoy
LQ Newbie
 
Registered: May 2004
Posts: 10

Rep: Reputation: 0
Hi ,
You can do it in the following way

g++ -shared -Wl,-soname, $(TARGET).so $(OBJS) $(LIBS)

where $(OBJS) are your several objectfiles
------------
regards
rshinoy
 
Old 06-30-2004, 06:37 AM   #4
ashwinipahuja
Member
 
Registered: Mar 2004
Posts: 79

Original Poster
Rep: Reputation: 15
Hi
thanx a lot, now i have lots of .a files.
How do i have to link together.
thanx in advance
 
Old 06-30-2004, 06:53 AM   #5
rshinoy
LQ Newbie
 
Registered: May 2004
Posts: 10

Rep: Reputation: 0
If you have many .a files using GNU archive you can achieve that.
DO a man ar .

--------
regards
Shenoy
 
  


Reply



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
c libraries kpachopoulos Programming 1 10-19-2005 05:37 PM
libraries sharapchi Slackware 2 03-10-2005 05:40 PM
g++ libraries ofada Programming 1 04-09-2004 11:47 AM
libraries exodist Linux - Software 9 09-04-2003 03:10 PM
libraries to use fatpig Programming 6 02-08-2002 06:50 PM

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

All times are GMT -5. The time now is 09:43 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
Open Source Consulting | Domain Registration