Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 7 months ago.
Calling mbed APIs from C source code
Hi, Sorry about my newbie questions, I am new to the C++ world. How do I call mbed APIs from a C code? Please note that I have a set of C source files delivered by a third party and I don't want to re-write the whole thing in a CPP file. I include meb.h in my C source file and got this error:
fatal error: cstddef: No such file or directory compilation terminated.
Thanks uCFreak
1 Answer
10 years, 7 months ago.
Easiest way to proceed is to rename all your .c files in .cpp files. That should solve most or all your problems since C++ is a superset of C. You just need to make sure that all files that include mbed stuff are compiled with the C++ compiler. That happens when the file extension is .cpp