I have some code that is shared between a C++ Windows application and an XC16 C application. The source is written in such a way that it compiles cleanly under MSVC and XC16 (with appropriate use of the __cplusplus
macro).
The problem is that XC16 refuses to build foo.cpp
. I have to copy the file to foo.c
and back again. This is wreaking havoc on revision control, and making code edits within the ide problematic when the copying functions are automated in the build process.
Is there a way to get XC16 to build (as C) a file with the extension cpp? (note that the header file is foo.h
, so it is not an issue).