issue in adding external library
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to add an external library in my project but getting the error as" error adding symbols, file format not recognized" I have followed the below steps:
- Add lib folder and .a library to the project workspace
2.Make sure you only specify library_name. in the project settings
For example, if you have a library called libmyxml.a, you will specify myxml in the Linker Libraries settings.
Note that you will also need to specify the location that you have placed the library archive in the Library search path (-L) setting
3. Add the lib to Project -> Properties -> C/C++ Build -> Settings -> Tool Settings
-> MCU Linker -> Libraries -> Libraries (-l)
kindly help.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you sure the library has been compiled for the MCU you are using?
It seems that the content is not compatible with what you have.
I hope this helps,
Erich
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the library which i have contains the header file and .a file.
I tried to compile it in a separate project and get another .a file.
But when i use the APIs of this library in main project, it shows undefined reference,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The archive (.a) is basically a collection of compiled object (ELF/Dwarf) files. The library needs to be compiled for your target (same processor) and be compatible with the toolchain used (e.g. GCC, memory model, EABI used, etc).
Ideally you have all the source files to build that .a file. If not, you need to contact the vendor/provider of that .a file.
Erich
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
anshun
You try this method its woks fine for me
https://mcuoneclipse.com/2013/02/12/creating-and-using-libraries-with-arm-gcc-and-eclipse/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
this link is not opening
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
.a file is already there but how to make it compatible with the ide i am using ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Where did you get the library from? From your description, I suspect that you did not get the correct ARM version of the library. Did you get the x86 version? Or perhaps a version for ARM Linux?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, i got x86 version.
when i build my project just by adding the library it gets build. But when I call those APIs it shows undefined reference error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You cannot link an ARM binary with a binary/archive/library compiled for x86. It simply cannot work. You will need a library built for the same ARM architecture.
I hope this helps,
Erich