|
Re: How to link the libi2c-dev library correctly [message #1711639 is a reply to message #1711598] |
Sun, 18 October 2015 20:40 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
Not really sure what you did and what linker you are using but if it isn't GCC but has similar options, you would supply both -L<path to lib(s)> -l<lib>. The -l option should not include "lib" as it will be added which in your case would be "-li2c-dev". Optionally, if it's an obvious library (ends in .a and .so), you could place a complete path specification to it on the command line without using an option and the linker will figure it out. I use my own make files and am not really sure how to get eclipse to provide a full path. However, I think you can supply a full path and name with the -l option though I've never tried it.
Again this is assuming what you are using works like GCC.
FWIW: Here are the GNU ld command line options.
ftp://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_3.html#SEC3
EDIT:
I just tried -l<full path and name> and it didn't work.
Also, I'm not really sure it isn't treating the naked .a file as a bunch of objects and all them are being dragged in. The names I'm using don't follow normal naming conventions that -l assumes so -l is not an, er, option.
[Updated on: Sun, 18 October 2015 23:31] Report message to a moderator
|
|
|
Re: How to link the libi2c-dev library correctly [message #1711722 is a reply to message #1711598] |
Mon, 19 October 2015 12:48 |
Tauno Voipio Messages: 742 Registered: August 2014 |
Senior Member |
|
|
It seems that you're making a cross-compilation to another Linux installation (Raspberry?). Please note that the shared libraries of the host Linux hardly ever can be linked to a cross-compiled executable.
Please tell:
- What is the development computer operating system?
- What is the target processor / operating system?
- Is the development library from the development or target
processor repository?
- Is the library an archive file (.a) or a shared library (.so)?
--
Tauno Voipio
|
|
|
Powered by
FUDForum. Page generated in 0.02155 seconds