Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » [SOLVED] Eclipse CDT Cannot find library (third party libraries)(Including libraries that do not follow linker naming scheme.)
[SOLVED] Eclipse CDT Cannot find library (third party libraries) [message #1778947] Tue, 26 December 2017 06:29 Go to next message
Michael Varghese Thomas is currently offline Michael Varghese ThomasFriend
Messages: 6
Registered: December 2017
Junior Member
I realise that this question has been asked a million times, but I have gone through those solutions and they have not helped me solve the issue.
I am trying to import a library called PDNALib.lib and a few header files. So I created a folder in the project director called "Include" and added the requisite files. I have attached the images below.

index.php/fa/31652/0/

index.php/fa/31653/0/


The compiler still isn't able to find the library. Is there something I am doing wrong? Should I follow some other step?

index.php/fa/31654/0/

[Updated on: Tue, 26 December 2017 09:48]

Report message to a moderator

Re: Eclipse CDT Cannot find library [message #1778948 is a reply to message #1778947] Tue, 26 December 2017 08:06 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
This is a common misconception.
It's not Eclipse CDT that can't find the library -- it's GCC
The compilers and linker are parts of GCC which is external to Eclipse.

You need to understand what the compiler and linker options actually mean to GCC.
They are merely passed by Eclipse through the makefile.
Here is a summary of GCC options: https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Option-Summary.html#Option-Summary

-I is a Directory Option: https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Directory-Options.html#Directory-Options
which tells the compiler preprocessor how to find #include files.

-include file tells the compiler to always include file for every compilation.
Something that is rare.
https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Preprocessor-Options.html#Preprocessor-Options

The limker options (https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Link-Options.html#Link-Options)
-Ldirectory appends directory to the library search path
-lxxx is shorthand which tells the linker to search library libxxx.a
Some versions of GCC will also search for libxxx.so and libxxx.lib
If your library doesn't follow the naming convention used by -l then add the library as an Other Object found in the Miscellaneous linker settings.

Re: Eclipse CDT Cannot find library [message #1778951 is a reply to message #1778948] Tue, 26 December 2017 09:45 Go to previous messageGo to next message
Michael Varghese Thomas is currently offline Michael Varghese ThomasFriend
Messages: 6
Registered: December 2017
Junior Member
Hey!! That worked!! I kept seeing solutions to the same problem asking people to remove the 'lib' prefix of the library file names and was getting frustrated that it wouldn't apply in my case. I did not know about this technicality or the ability to add other objects. Thank you so much!! That's one new I learned today.
Re: Eclipse CDT Cannot find library [message #1781001 is a reply to message #1778948] Wed, 31 January 2018 08:33 Go to previous message
Klaus Mezger is currently offline Klaus MezgerFriend
Messages: 1
Registered: January 2018
Junior Member
I tried all imaginable solutions, but always get the following error message:

c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lF:/Projekte/eclipse-workspace/WPL_25-Interface/vs_can_api.lib.

Compiler seems to find the *.lib because no missing references are marked.

I tried with or without extension, under same drive like MinGW, as linker settings "other object" and many other ideas including adding the path to the dll.

Same library works with same MinGW under Netbeans.
Any idea?

Thanks a lot for some tips!
Klaus
Previous Topic:How can I include .s file in C project
Next Topic:Eclipse program crashing when connecting to MySQL Server
Goto Forum:
  


Current Time: Tue Apr 23 11:30:21 GMT 2024

Powered by FUDForum. Page generated in 0.02447 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top