This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Declar Classes in Header files in C++

Hi,

This may be stupid, but I can't declare classes in my .h file in keil. I have arduino library for my I2C device, but keil; does not recognize when I declare classes.

image description

Thanks.

  • Nordic SDK is written in C99 not C++. Keil has problems with mixing C99 and C++ code and so far the only solution I've found is to set c99/c++ compilation manually in options for each file separately. That said there are problems to use Nordic SDK calls in c++ code because it heavily uses extended struct initializers struct foo_s foo={. bar=baz};which are not implemented in ARM C++ compiler and g++.

Related