|When passing library file names using the -l option strip of the lib prefix and the extension. If for example the file name is libcv2.so, pass -lcv2 as option.
See Link Options - Using the GNU Compiler Collection (GCC)[^].
If the library file does not match this style (lib prefix, .a or .so extension, or you want to link dynamically to a .so file but there is also a matching .a file), you can pass the full name with path as argument like for object files (gcc recognises if the file is an object file or a libray).
I can't help much regarding Eclipse. But a quick search shows that there are two different sections where you can configure libraries:
- The general library settings (C/C++ Properties - Folder - General - Paths and Symbols)
- The project and tool specific settings (C/C++ Properties - Project - Build - Settings - Tool Settings - Linker)
The first should be used for system wide general library paths while the second is for project specific settings. To add an object or library with full path and name, enter it at Miscellaneous - Other objects.