Hi,
I have started to receive an error I am not sure how to fix. This seems to be related to the library EWL and linking of the project.
I am using: CodeWarrior for MCU Version: 10.6.4 Build Id:150416.
Target processor Kinetis MK21FN1M0VMC12
The project has compiled well but now I started to get this error message, no changes to the source code has been made. It must have to do with the build settings as I can understand.
The console message is:
In file included from C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C++/include/lib_ewl_c++.prefix:12:0,
from <command-line>:0:
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/lib_ewl.prefix:16:0: warning: "_EWL_C99" redefined [enabled by default]
C:/Freescale/Freescale_MQX_4_2/lib/NS_READER.cw10gcc/debug/bsp/NS_Reader.h:126:7: warning: #warning Flexbus is sharing pin with SPI0 moudle, hence enabling SPI0 that cause some demo use flexbus (mfs_ramdisk) do not run properly [-Wcpp]
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/cstdio: In function 'int std::getchar()':
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/cstdio:1116:22: error: cannot convert 'MQX_FILE_PTR {aka mqx_file*}' to 'std::FILE* {aka std::_FILE*}' for argument '1' to 'int std::getc(std::FILE*)'
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/cstdio: In function 'int std::putchar(int)':
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/cstdio:1123:26: error: cannot convert 'MQX_FILE_PTR {aka mqx_file*}' to 'std::FILE* {aka std::_FILE*}' for argument '2' to 'int std::putc(int, std::FILE*)'
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/cstdio: In function 'int std::getchar()':
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/cstdio:1116:22: error: cannot convert 'MQX_FILE_PTR {aka mqx_file*}' to 'std::FILE* {aka std::_FILE*}' for argument '1' to 'int std::getc(std::FILE*)'
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/cstdio: In function 'int std::putchar(int)':
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/cstdio:1123:26: error: cannot convert 'MQX_FILE_PTR {aka mqx_file*}' to 'std::FILE* {aka std::_FILE*}' for argument '2' to 'int std::putc(int, std::FILE*)'
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/cstdio: In function 'int std::getchar()':
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/cstdio:1116:22: error: cannot convert 'MQX_FILE_PTR {aka mqx_file*}' to 'std::FILE* {aka std::_FILE*}' for argument '1' to 'int std::getc(std::FILE*)'
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/cstdio: In function 'int std::putchar(int)':
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/cstdio:1123:26: error: cannot convert 'MQX_FILE_PTR {aka mqx_file*}' to 'std::FILE* {aka std::_FILE*}' for argument '2' to 'int std::putc(int, std::FILE*)'
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/cstdio: In function 'int std::getchar()':
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/cstdio:1116:22: error: cannot convert 'MQX_FILE_PTR {aka mqx_file*}' to 'std::FILE* {aka std::_FILE*}' for argument '1' to 'int std::getc(std::FILE*)'
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/cstdio: In function 'int std::putchar(int)':
C:/Freescale/CW MCU v10.6.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/cstdio:1123:26: error: cannot convert 'MQX_FILE_PTR {aka mqx_file*}' to 'std::FILE* {aka std::_FILE*}' for argument '2' to 'int std::putc(int, std::FILE*)'
mingw32-make: *** [Sources/CMOS.o] Error 1
mingw32-make: *** Waiting for unfinished jobs....
mingw32-make: *** [Sources/NeuralNetwork.o] Error 1
mingw32-make: *** [Sources/RF.o] Error 1
mingw32-make: *** [Sources/App.o] Error 1
Any suggestions are much appreciated, thanks.
Hello,
Please check the below thread and let me know if this helps!!
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi,
I did look at that thread but I dont think that is the problem I got. I have been able to build the project successfully without any changes to the source code before. This time it seems to be library or linker settings. I am not sure at all, dont understand the error.
Thanks,
Lars
Hi,
This is where the errors occur in the cstdio:
/** | The getchar function is equivalent to getc with the argument stdin. | |
* | ||
* | The getchar function returns the next character from the input stream pointed to by | |
* | stdin. If the stream is at end-of-file, the end-of-file indicator for the stream is set and | |
* | getchar returns EOF. If a read error occurs, the error indicator for the stream is set and | |
* | getchar returns EOF. | |
*/ | ||
inline int _EWL_CDECL getchar() | ||
Error ----> | { return getc(stdin); } |
/** | The putchar function is equivalent to putc with the second argument stdout. | |
* | The putchar function returns the character written. If a write error occurs, the error | |
* | indicator for the stream is set and putchar returns EOF. | |
*/ | ||
inline int _EWL_CDECL putchar(int c) | ||
Error ---> | { return putc(c, stdout); } |
Regards,
Lars
Hi,
The simple and dirty solution is of course just to comment away the return statements and leave the functions empty, the project will then build succesfully, and in the case the functions are not used, (hopefully) nothing happens. It still doesn't answer the question on how to correctly address the issue.
Grateful for an explanation.
Regards,
Lars
Hello Lars,
You can submit a CASE (service request) at the following link this is in order you can send the project, because we need to reproduce the issue
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Sol,
I can send the project to you as a Freescale/NXP contact since I have an NDA with you. I do not wish to publish it in public. Please let me know an email where you can download a google drive link.
Regards,
Lars