Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Add library paths on Eclipse IDE C/C++ 4.20.0
Add library paths on Eclipse IDE C/C++ 4.20.0 [message #1848383] Tue, 30 November 2021 12:38 Go to next message
Mallorquín Colina is currently offline Mallorquín ColinaFriend
Messages: 1
Registered: November 2021
Junior Member
I'm using Eclipse IDE C/C++ (version: 2021-06 (4.20.0)) with IDF plugging and I would like to use external libraries besides of ESP-IDF libraries. I read this IDE version doesn't include a menú option to add library paths, and if want to use external libraries I must créate a folder into my Project and copy them in it, and finally modify CMakeLists.txt file to include the following code line: set(COMPONENT_ADD_INCLUDEDIRS "../folder_name").

When I compile an example which includes a function which belongs to an external library I get the error "undefined reference to 'function_name'.

Are correctly the steps that I followed or there is another way to add external libraries?

Thank you for your reply.
Re: Add library paths on Eclipse IDE C/C++ 4.20.0 [message #1848390 is a reply to message #1848383] Tue, 30 November 2021 17:56 Go to previous message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 733
Registered: August 2014
Senior Member
It seems that you're using CMake to build the program, so the question is actually off-topic for Eclipse CDT.

To include an external module or library, you need to do two things:

- tell the compiler how to compile proper calls to the module. This is done by including the header file to the compilation,

- tell the linker where to get the library code from. This is done by adding the module object code or library code to the linker arguments.

If I interpreted your question properly, you have done the first thing, but not the second one. Please get the CMake documentation to see how to add the library to your CMakelists.txt.


--

Tauno Voipio
Previous Topic:Unable to set breakpoints without restarting application during debug
Next Topic:I can't launch my eclipse
Goto Forum:
  


Current Time: Sat Oct 01 15:03:06 GMT 2022

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

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

Back to the top