2026-05-10 4:46 AM - last edited on 2026-05-10 4:48 AM by Peter BENSCH
hi,
I created a project by the MCSDK, i tried running it as a C++ project, but im getting an error compilation that i cant solve:
../../MCSDK_v6.4.2-Full/MotorControl/MCSDK/MCLib/Any/Inc/revup_ctrl.h: In function 'void RUC_Stop(RevUpCtrl_Handle_t*)':
../../Inc/mc_type.h:77:32: error: invalid conversion from 'void*' to 'RevUpCtrl_PhaseParams_t*' [-fpermissive]
77 | #define MC_NULL (void *)(0x0)
| ^
| |
| void*
it seems that there is a wrong casting issue.
I tried to solve it in some fifferent wauys like:
pHandle->pCurrentPhaseParams = (RevUpCtrl_PhaseParams_t*)(malloc(MC_NULL));
or
pHandle->pCurrentPhaseParams = static_cast<RevUpCtrl_PhaseParams_t *>malloc(sizeof(MC_NULL));
but its not solving the issue.
but when i tried to delete this line it keeps having the same error !!!!!!
what could be the problem
2026-05-17 4:12 PM
How come that these .c files are compiled in c++ mode?
This snippet: static inline void RUC_Stop(....) ... is in one of generated .c files or your own .cpp file?