6 years, 2 months ago.

why I can't compiler?


Question relating to:

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

3 Answers

6 years, 2 months ago.


that error usually means that the mbed library linked to the program is not up to date and does not include code needed for your target. Please verify the TARGET chosen in the online compiler and that the mbed library is up to date (update it to the newest revision).


Accepted Answer

I"m getting this same error both with mbed and mbed-src using the nRF51822 board. I just create a new program based on "Blinky LED Hello World", and It says it can't find device.h when I try to compile. I've made sure the mbed package is updated.

posted by Brian Webb 03 Jul 2014

Brian, what revision is mbed lib? It's not just update, but have to go to Revision options where to switch to a newer version. Does that help?

posted by Martin Kojtal 03 Jul 2014

It's showing that it's at revision 86, which looks to be the latest.

posted by Brian Webb 03 Jul 2014

If I switch to revision 85 it compiles...

posted by Brian Webb 03 Jul 2014

Looking at the changes, it looks like device.h for the nRF51822 was removed/moved in revison 86.

posted by Brian Webb 03 Jul 2014

It seems to be working just fine when running in betamode (http://mbed.org/betamode/)

posted by Stian Jensen 15 Jul 2014
6 years, 2 months ago.

Did you import the "device" library device.h is refering to?

I Had.

posted by LIU SHUANG 28 Jun 2014

Have you been able to get your programmed compiled? If not could you include a screenshot showing your workspace for your project?

posted by Jack Chiu 29 Jun 2014
6 years, 2 months ago.

Select the folder on the left side of the compiler: My Programs / blink_led / mbed-src / targets / hal / .... only the platform (board) for which compile "main.cpp". Other clear.