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
  • Use one of the following notations to declare that an object or function has the linkage of language language_name:

    extern “<i>language_name" declaration</i> ;

    extern “<i>language_name</i>“ { <i>declaration ; declaration </i>; ... }

    The first notation indicates that the declaration (or definition) that immediately follows has the linkage of language_name. The second notation indicates that everything between the curly braces has the linkage of language_name, unless declared otherwise. Notice that you do not use a semicolon after the closing curly brace in the second notation.

    java training institute in hyderabad

Reply
  • Use one of the following notations to declare that an object or function has the linkage of language language_name:

    extern “<i>language_name" declaration</i> ;

    extern “<i>language_name</i>“ { <i>declaration ; declaration </i>; ... }

    The first notation indicates that the declaration (or definition) that immediately follows has the linkage of language_name. The second notation indicates that everything between the curly braces has the linkage of language_name, unless declared otherwise. Notice that you do not use a semicolon after the closing curly brace in the second notation.

    java training institute in hyderabad

Children
No data