5 years, 8 months ago.

#include "x.h" on source code and what about x.o?

Hi! Env: nrf51822

I am trying to add flash persistence to a working ble project.

In main .c I added: ...

  1. include "pstorage.h"
  2. define NEEDS_PSTORAGE 1
  3. include "nrf_error.h"

And I started to call functions like

pstorage_init() pstorage_register() Etc

When I compile I see errors like this:

Error: Undefined symbol pstorage_init() (referred from /build/./main..........).

It seems that project does not know the related implementation (.c or .o) right?

How to add implementation support to the pstorage module in mbed?

The needed files are in the project tree: ./nRF51822/source/nordic-sdk/components/drivers_nrf/pstorage/ config pstorage.c pstorage.h

In commandline nrf51 sdk / gcc, we add pstorage.c to the makefile. What about in mbed web IDE?

Thanks a lot

Extern C!!!

posted by Alex Co 13 Jul 2018

Did you add pstorage.c to the project in the web IDE?

posted by Andy A 16 Jul 2018

1 Answer

5 years, 8 months ago.

Hello Alex,

Looking at your comment, were you referencing this questions here?:

https://os.mbed.com/questions/5056/Linker-error-when-using-pstorage/

Were you able to successfully compile your program? Let us know if you have as well as if you have any more questions!

-Karen, team Mbed

If this solved your question, please make sure to click the "Thanks" link below!