LinuxQuestions.org
Visit Jeremy's Blog.
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 09-28-2001, 05:40 PM   #1
toxic53
Member
 
Registered: Sep 2001
Posts: 30

Rep: Reputation: 15
Libraries Question


I'm trying to add some libraries that I like to use ... I dont know how to add them to my machine.... I have all the .c and .h files... where should I save those files? and how can I use them like in a regular c program.... would it be like:

#inlude"simpio.h"

if simpio.c was the source for the library and simpio.h is the header file??? where do I save these so that everyone on the machine has access to these libraries..

Thanks
 
Old 09-28-2001, 07:09 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
I think what you are after are precompiled libraires. Where you would just do a include like, #include "myfile.h", and link the rest of the library in at link time. To do this you need to compile you .c files into .o and then use the ar command to create a .a archive.

When you want to build you executable using the library created above, you would inlcude a -lname on the link or compile option to link it in. You should read the man page for both the compiler and linker to get full details.
 
Old 09-29-2001, 12:18 AM   #3
isajera
Senior Member
 
Registered: Jun 2001
Posts: 1,635

Rep: Reputation: 45
crabby!!! nice to see you back. we thought you'd disappeared.
 
  


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
libraries/headers locations question (compiling) shilo Slackware 1 10-04-2005 12:01 PM
shared libraries question rhb327 Slackware 2 09-23-2005 10:49 AM
Question about libraries Scrob Linux - Newbie 3 02-21-2005 10:03 PM
simple rpm and libraries question whitehole Fedora 1 10-18-2004 10:58 AM
Shared libraries question...need help tarballed Linux - General 3 03-15-2003 01:04 PM

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

All times are GMT -5. The time now is 08:36 PM.

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