paths are included as below in both compiler MCU C and MCU C++, both libraries work fine in cmake as stand-alone projects but not in MCUxpresso even after adding the paths as shown in the screenshots.
the undefined reference error is applicable and occurs to all functions in which called from either of the two cJSON.h or or json.h but never on cmake since it knows where to go! Really frustrating with latest NXP SDK's API where they removed the cJSON api which was even a replica to the repository and didn't include instructions to integrate this stubborn IDE!
Solved! Go to Solution.
I had merged the library with my project, it took quite some time since files weren't coded for ARM GCC compiler. I hope that the next NXP's SDK release would include Cjson or json-c natively to avoid such a dramatic additional work. I am not sure why would NXP refrain adding either of the two libraries, but they really have to since almost all modern applications deploy json files. I couldn't find a way to inform NXP to add those utterly valuable libraries in their SDK, but if someone does, it would be quite helpful for all NXP ARM developers
I had merged the library with my project, it took quite some time since files weren't coded for ARM GCC compiler. I hope that the next NXP's SDK release would include Cjson or json-c natively to avoid such a dramatic additional work. I am not sure why would NXP refrain adding either of the two libraries, but they really have to since almost all modern applications deploy json files. I couldn't find a way to inform NXP to add those utterly valuable libraries in their SDK, but if someone does, it would be quite helpful for all NXP ARM developers
Undefined reference is a *linker* error. You have not added the json library to the linker.
paths are already added in the linker, yet the problem prolongs
Have you added the cjson library to the linker? Snapshot the linker libraries page, and post it.
note. If the library is called libcJson.a you just add cJson to the linker (it will automatically add lib to the front and .a to the end)
still nothing!
Remove the first three letters “lib” from the name of the library. See my earlier comment
persisting to never work out! (with/without lib or .a) even after cleaning and re-building the project
it works at this path now but I got a brand new absurd error! Apparently, the .so file isn't recognized
Where did you get this library? .so file is a Linux shared object library, which is not compatible with embedded devices. You will need to find a version of this library built for ARM Cortex embedded applications.
unfortunately, most of C/c++ based library are GCC for x86/64 and not ARM, I got it from here;
if you know one that works with ARM, please share it!
Well, you are not going to get a Linux x86 library linking with anything for Cortex. But the site you pointed at provides source code, so you can just download the source code and build it yourself - but it may need some porting. For example if it is designed for Linux, it may use Linux system services, that will not be available on your target device.