LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-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: 48
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: 244Reputation: 244Reputation: 244
It is possible, just make sure the lib file is not a symlink. But I think you will need the -l option though.
 
  


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
/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

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

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