Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 09-10-2004, 04:27 PM   #1
Registered: Aug 2004
Location: Germany
Distribution: Slackware 10.0
Posts: 258

Rep: Reputation: 30
How to link a lib?

Hi there!

I've got a little question about something really essential... nOObiE - Question

When I want to use a library... delivered with a programm (in my case this is a lib delivered with gpsd)... how do I do this exactly?

I have a file ... the lib itself... where do I have to put it? Is it enough put put it into the compiling directory?

And then I habe to link against it in some way... or not?

Thanks a lot,.. greetings, Sascha
Old 09-10-2004, 04:36 PM   #2
Senior Member
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
A .so file ( the library itself ) is usually in /usr/lib, to link your program to it you pass options on the command line when compiling you have to pass a library path with -L and the actual lib with -l without the .so extension.

-L /usr/lib -lthelib
Old 09-11-2004, 02:22 AM   #3
Registered: Aug 2004
Location: Germany
Distribution: Slackware 10.0
Posts: 258

Original Poster
Rep: Reputation: 30
Ok,.. that sou8nds easy...

How about placing the lib in the directory, in which I compile to prgramm? Is that possible? If so, I think I can let the -L /path/to/lib/ away?

Thanks very much!

GReetings, Sascha
Old 09-11-2004, 03:10 AM   #4
Senior Member
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
It is possible, just make sure the lib file is not a symlink. But I think you will need the -l option though.


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
/sbin/ldconfig: /usr/lib/ is not a symbolic link rosariowong Slackware 13 04-29-2005 03:41 PM
symbolic link in /lib alice95089 Linux - Software 1 02-07-2005 08:28 PM
Compromised? Files "/usr/lib.hwm", "/usr/lib.pwd", "/usr/lib.pwi" Klaus Pforte Linux - Security 4 09-28-2004 11:33 PM
IdConfig: /usr/lib/.... is not a symbolic link. _tomMmy_ Linux - Software 0 08-23-2004 07:12 AM
iiimf-client-lib & iiimf-protocol-lib cooldownguy86 Linux - Software 1 06-29-2004 06:25 AM > Forums > Non-*NIX Forums > Programming

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