I have a project that uses RTX and Keil middle-ware running on a NXP 43xx processor. I have recently changed the compiler settings from C to C++ due to incorporating a commercial library that is written in C++. The project now complies and runs property but now no RTX task information is displayed in the uVision debugger “System and Thread Viewer” window.
To remove compiler errors I had to modify all of the global variable definitions in the library interface modules, RTX_lib.c, Net_lib.c and File_lib.c as in this example:
Original definition
U32 const os_trv = OS_TRV;
Modified definition
#ifdef __cplusplus extern "C" U32 const os_trv = OS_TRV; #else // CHRISB U32 const os_trv = OS_TRV; #endif
Originally I was using uVision v4.72 then upgraded to uVision v5.13 with legacy support. Both compiler versions have the same problem of not showing task information. I have double checked all of the project settings and other than “—cpp” compiler directive everything is the same.
Any help would be appreciated. Thanks
Wouldn't it have been easier to do:
#if defined(__cplusplus) extern "C" { #endif U32 charlie; U32 benny; U32 johnny; ... void some_function(void); ... #if defined(__cplusplus) } #endif
instead of adding extern "C" on every line?
Thanks, no doubt would have been easier. However I just copied what Keil did in RTX_Config.c etc. to make the library functions visible from C++. I don’t really understand why Keil made the library functions visible but not the library globals.