|
|
|
|
Re: Linking to Libraries [message #850650 is a reply to message #849966] |
Fri, 20 April 2012 07:50 |
Axel Mueller Messages: 1973 Registered: July 2009 |
Senior Member |
|
|
Chris Miami wrote on Thu, 19 April 2012 18:19I am having a similar issue and this FAQ entry has 3 orthogonal suggestions for how to do it, leading the new user (me) to believe that no one really knows the real answer (none of the methods seemed to work).
There is another confusion, as there are two entirely different prefs panes (C/C++ Build/Settings and C/C++ General/Paths and Symbols) that seem to do the same thing, and no direction on why/when to use one or the other.
Chris
C/C++ Build/Settings:
These are setting for the compiler.
- open Project Properties->C/C++ Build/Settings
- hit the "Libraries" item under "GCC C++ Linker"
- in the upper pane click the + symbol and enter name of your library; omit lib prefix and trailing .dll or .so; e.g. if your library is named libfoo.so you will enter foo
BTW, if your lib is called libfoo.so.1.0 you must create a symlink called libfoo.so that links to this file. The linker neeeds always libfoo.so (w/o version number) but for runtime libfoo.so.1.0 is needed!
- in the lower pane you can enter the path to the library (only necessary if your library is not in the system path, i.e. /usr/lib)
C/C++ General/Paths and Symbols:
Here you can define things for the Eclipse indexer if it was not able to automatically discover everything you need. The indexer is needed for code completion etc. This has *nothing* todo with the compiler settings!
If you are successful with the above steps you can adapt the instructions on the wiki page http://wiki.eclipse.org/CDT/User/FAQ#How_do_I_add_an_external_library_to_my_C.2B.2B_project.3F
Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
|
|
|
Powered by
FUDForum. Page generated in 0.03228 seconds