Robert Lewis

Include of stdlib.h causes fatal errors for CW10.2 MQX 3.8

Discussion created by Robert Lewis on Jul 5, 2012
Latest reply on Jul 5, 2012 by Robert Lewis



It was suggested under the CW10.2 forum that this might be an MQX error so I am reposting here.



I needed to use atoi in the code so added the usual #include <stdlib.h> in the code. Now I get these bizarre errors


Description Resource Path Location Type  identifier 'exit(int)' was originally declared as '__regabi int (int)' rap11_cw10.2_mqx3.7_51jm128  line 89, external location: C:\Freescale\Freescale MQX 3.8\lib\m51jmevb.cw10\usb\host\mqx_host.h C/C++ Problem identifier 'exit(int)' redeclared as '__regabi void (int)' rap11_cw10.2_mqx3.7_51jm128  line 157, external location: C:\Freescale\CW MCU v10.2\MCU\ColdFire_Support\ewl\EWL_C\include\cstdlib C/C++ Problem mingw32-make: *** [Sources/Tasks_c.obj] Error 1 rap11_cw10.2_mqx3.7_51jm128    C/C++ Problem


After searching through the net and everywhere Icould think, I noted that someone found that there is some pragma statement somewhere that changes the register used for return values in a function call. I have no idea where that is or how to change it.


Does anyone have a fix for this? This seems pretty basic functionality and we shouldn't have to go through this to compile normal code. This is an existing project that has been used for sometime but without the include.

Thanks in advance.