LinuxQuestions.org
Visit the LQ Articles and Editorials section
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-10-2004, 04:27 PM   #1
theonebeyond
Member
 
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
leonscape
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
theonebeyond
Member
 
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
Cedrik
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.
 
  


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
/sbin/ldconfig: /usr/lib/libgtkhtml-3.0.so.2 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


All times are GMT -5. The time now is 12:40 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration