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

RTX error L6218E in C++

Hi guys,

I'm suffering from an issue similar to this post:

http://www.keil.com/forum/17963/

Where switching to C++ has caused linker errors due to C/C++ mixing. I followed the same advice, however just the action of adding configuration file RTX_Conf_CM.c to my project causes these errors before I've even included any RTX related files and used any of RTX in my own code.

I have attempted to surround RTX_Conf_CM.c in extern "C" { } to no avail.

Any ideas what I may have to change?

Many thanks

Parents
  • You were exactly correct, the compiler wasn't recognising the .c extension as being C only and was compiling as C++ with extern "C" having no effect. Setting the --c99 flag on the file locally overrode this setting.

    For the record I don't think the issue was directly with this file, however it goes on to include RTX_lib.c that unlike the RTL.h header doesn't have provisions for extern "C" in the event of C++ compilation.

    Many thanks for all the help.

Reply
  • You were exactly correct, the compiler wasn't recognising the .c extension as being C only and was compiling as C++ with extern "C" having no effect. Setting the --c99 flag on the file locally overrode this setting.

    For the record I don't think the issue was directly with this file, however it goes on to include RTX_lib.c that unlike the RTL.h header doesn't have provisions for extern "C" in the event of C++ compilation.

    Many thanks for all the help.

Children
No data