pfried
pfried

Reputation: 5089

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

Upvotes: 1

Views: 912

Answers (1)

Jan Jongboom
Jan Jongboom

Reputation: 27352

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.

Upvotes: 2

Related Questions