Hello,
I have a base project that uses C99. (compiler option --c99)
Basically c99 was used so that an aggregate type could be initialized with non-constant data as such:
#define WRITE_OP_CODE (34)
void test_fn(unsigned char param1, unsigned char param2) { unsigned char writebuff[3] = {WRITE_OP_CODE, param1, param2}; // no error on one compiler // and a "expression must have a constant value" error on another
... } The problem is I am now mixing in some c++ (third part library) and I get all sort of errors for the C linkage (extern "c")
Does anyone have a suggestion as to how to mix C99 and C++ with various extern c linkage statements? Thanks
Please pay attention to the instructions for posting source code: www.danlhenry.com/.../keil_code.png
Mixing C & C++ has nothing specifically to do with Keil - so start by just googling for general tutorials, etc.
If you need to use C++ in a project, I think the general advice is that it's easier to make it a C++ project - rather than try to add C++ support to a C project ...