|
Re: configuering eclipse c++ for HDF libraries [message #1803955 is a reply to message #1803781] |
Thu, 14 March 2019 09:24 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
Eclipse expects you to understand how to use the tools it calls.
The GNU Toolchain is one such set.
The GNU linker is named ld and is packaged with binutils
The latest online documentation for binutils is at https://sourceware.org/binutils/docs-2.32/
The documentation for ld is at https://sourceware.org/binutils/docs-2.32/ld/index.html
The command line options for ld are at https://sourceware.org/binutils/docs-2.32/ld/Options.html#Options
Scroll down to -l and -L
Eclipse doesn't call ld directly but uses g++ instead.
The only real difference is that some linker options must be used with -Wl,<ld option>
The command line option for the linker,-lXXX, is shorthand for libXXX.<a or so> with .so preferred if both can be found.
The linker will search the library path search list for the libraries.
-L<path> prepends <path> to the search list.
You set these using Eclipse/CDT with
Project --> Properties --> C/C++ Build --> Settings --> Tool Settings tab --> GCC C++ Linker --> Libraries dialog.
You already have -L<path> set so you need to remove the -l<path>lib from the library names.
For example, -lhdf5_hl_cpp for /usr/local/lib/hdf5-1.10.4/lib/libhdf5_hl_cpp.so
Alternately, you can specify the library directly using
Project --> Properties --> C/C++ Build --> Settings --> Tool Settings tab --> GCC C++ Linker --> Miscellaneous dialog as Other Objects.
You should include the complete path name for the library when using this.
In which case, you should drop the -l from the name.
HTH
[Updated on: Thu, 14 March 2019 09:34] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02541 seconds