This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Calling C++ function on C main

Hi,

I'm a beginner on MCU programming (STM32F4 discovery)

I'm building my code on C language. Recently, i find some library in C++ can achieved my job.
However, when i compile it, errors occurred.

"#20: identifier "namespace" is undefined _RWSTD_NAMESPACE_BEGIN (__rw)
"#65: expected a ";" ......

I think the issue comes from the compiler is C compiler which cannot compile C++ code.

How can i do with this case ?

Thank you.

Parents
  • You can either:
    1. change the extension of your file to .cpp - if it does not mix C and C++.
    2. Right click on the file name / logical folder to select the compiler to use.
    3. Only use C++ file extensions throughout the entire project.
    4. Use the preprocessor but I would not recommend that at all.

Reply
  • You can either:
    1. change the extension of your file to .cpp - if it does not mix C and C++.
    2. Right click on the file name / logical folder to select the compiler to use.
    3. Only use C++ file extensions throughout the entire project.
    4. Use the preprocessor but I would not recommend that at all.

Children
No data