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 11-08-2011, 03:20 PM   #1
Zssfssz
Member
 
Registered: Sep 2011
Location: Las Vegas!
Distribution: Ubuntu n' Flavors, ReactOS, MINIX3, FreeDOS, Arch
Posts: 339

Rep: Reputation: Disabled
Making a Static Lib.


Well just mastered DLLs a few days ago and now I want to make a plain static libary. I really have no need... I just love files.
thats the reason I started programing, file IO/Useage.
C++
 
Old 11-09-2011, 03:11 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
good luck!
 
Old 11-09-2011, 10:32 PM   #3
Zssfssz
Member
 
Registered: Sep 2011
Location: Las Vegas!
Distribution: Ubuntu n' Flavors, ReactOS, MINIX3, FreeDOS, Arch
Posts: 339

Original Poster
Rep: Reputation: Disabled
I'm sorry sometimes I word my questions as a statement or forget what I'm doing...
The question is:
How to make a static libray?
 
1 members found this post helpful.
Old 11-09-2011, 10:39 PM   #4
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
Code:
# Step 1: make some objs
gcc -c foo.c -o foo.o
gcc -c bar.c -o bar.o

# Step 2: make a lib out of them
ar rcs libbaz.a *.o

# Step 3: Profit, win, explore.

Last edited by jhwilliams; 11-09-2011 at 10:41 PM.
 
Old 11-10-2011, 02:25 AM   #5
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Quote:
Originally Posted by Zssfssz View Post
How to make a static libray?
Platform dependent. You seem to use Windows, where it is compiler-dependent as well.
 
Old 11-10-2011, 10:44 AM   #6
Zssfssz
Member
 
Registered: Sep 2011
Location: Las Vegas!
Distribution: Ubuntu n' Flavors, ReactOS, MINIX3, FreeDOS, Arch
Posts: 339

Original Poster
Rep: Reputation: Disabled
MinGW compiler, Code::Blocks handels all of the tags for me.
 
Old 11-10-2011, 10:57 AM   #7
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Then you have a good chance that your IDE has a 'create library' function; or you may have got an ar utility (see jhwilliams's reply).
 
  


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
CMake Static Lib Dtag Programming 5 02-08-2012 12:15 AM
Attaching lib.so while creating static lib barunparichha Linux - Software 1 07-16-2011 03:50 PM
Static Lib subramani Programming 1 04-25-2011 12:11 AM
Making a static lib from objects + static libs kovacsp Programming 2 12-19-2007 12:53 PM
How do I create a static lib with g++? BrianK Programming 1 05-27-2005 07:30 PM

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

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