简体   繁体   中英

mbed-os compile - <new> library missing in arm-gcc

I am getting the following error message when i have mbed-os and my own library installed side by side

folder layout:

.
|_mbed-os
|_library

/mbed-os/platform/Callback.h:21:15: fatal error: new: No such file or directory compilation terminated.

which is originating form the following line:

#include <new>

Including from this file:

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @file timer_platform.h
 */
#include "mbed.h"
#include "timer_interface.h"

/**
 * definition of the Timer struct. Platform specific
 */
struct Timer Timer;

#ifdef __cplusplus
}
#endif

The error occurs when i run mbed compile

I am running Windows 10 64bit with mbed-cli in version 1.0.0. The compiler is the gcc-arm-none-eabi 5.4

Where should this library be located? How can i track the error down? I am quite new to C++ but do have some experience with C

I think this is because you're referencing the mbed.h header (or Callback.h ) from a .c file. Rename to C++.

If you need the file to be C, then wrap in an extern "C" {} block.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM