Adding C static library to my project [message #1769764] |
Thu, 03 August 2017 05:04  |
Eclipse User |
|
|
|
I've been working on a project for embedded system and it needs SSL/TLS functionality.
I downloaded SSL project from GitHub (WolfSSL to be specific), compiled it with autotools, then created a static library libwolfssl.a using ar from libtools which archived all the .o files
I need to use the functions implemented in WolfSSL in my code, for example SSL_Library_Init()
How can I add the static library and use the functions using Eclipse IDE ?
I tried the following:
Added library path to the C linker -L: ${workspace_loc:/${ProjName}/lib}
Added library name to -l : wolfssl where the library name is libwolfssl.a
When I try to build the project, anything related to SSL is not recognized yet, ex: SSL_Library_Init and so on
Is this the correct way to do this?
|
|
|
|
|
|
|
|
|
|
|
Re: Adding C static library to my project [message #1828000 is a reply to message #1827992] |
Thu, 28 May 2020 17:30  |
Eclipse User |
|
|
|
Your question is really broad.
It's the logical equivalent of purchasing a machine shop with lots of tools
then asking how to build an automobile with it.
If you don't already know how, you likely wouldn't understand the answers.
The short answer is: it's complicated.
A somewhat longer answer is:
- You write your code
- Tell the compiler where to find the library interface descriptions (header files)
- Tell the linker how to generate an executable (libraries to use and where to find them)
- Convert the executable into one you can use on your target machine
You really need to know how to do that without using Eclipse.
Afterwards, it will become rather obvious how to set the options when using Eclipse.
Eclipse uses Make (or some functional equivalent) to perform builds.
A Makefile usually breaks the build task into (1) compiling modules then (2) linking them.
If Eclipse is not generating the Makefile then you don't tell it anything -- your Makefile does it all.
My suggestion is learn how to compile and link executables from the many tutorials available on the Internet.
Once you understand how to do that and you still don't understand how to tell Eclipse
then post a new question with specifics on what you've tried and what you expected.
[Updated on: Fri, 29 May 2020 03:57] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.06549 seconds