Hello,
I cannot build an MQX 4.2 C++ project in CW 10.6.4 if I include rtcs. Using the project wizard I create a basic application/cplus project, confirm it runs then add rtcs to the project. I get the following errors:
C:/Freescale/Freescale_MQX_4_2/lib/frdmk64f.cw10gcc/debug/rtcs/rtcs_sock.h:626:39: error: expected ',' or '...' before 'readfds'
C:/Freescale/Freescale_MQX_4_2/lib/frdmk64f.cw10gcc/debug/rtcs/rtcs_sock.h:636:37: error: expected ',' or '...' before 'option_value'
Regards,
-Mike
Add "--restrict" to compiler misc control.
Hi Michael, did you solve the problem?
I'm with exactly the same problem.
C:/Freescale/Freescale_MQX_4_2/lib/frdmk64f.cw10gcc/debug/rtcs/rtcs_sock.h:626:39: error: expected ',' or '...' before 'readfds'
C:/Freescale/Freescale_MQX_4_2/lib/frdmk64f.cw10gcc/debug/rtcs/rtcs_sock.h:636:37: error: expected ',' or '...' before 'option_value'
I tried all the things above and didn't solve the compiler error.
I'm developing a custom board and a custom project derived from MQX 4.2 and cplus example.
I'm using CW 10.6.
Regards,
Diego
I solved the problem.
The problem is the "restrict" keyword in the declaration of the functions select() and getsockopt() in the rtcs_sock.h file.
I suppose that is any incompatibility between the "restrict" keyword and the C++ compiler.
So, I just remove the keyword and it works.
Hi Michael:
Please refer to the following document for creating a new MQX project using GCC C++
https://community.nxp.com/docs/DOC-101405
Regards
Daniel
Hi Daniel,
I'm getting compile errors with rtcs because MQX_SUPPRESS_STDIO_MACROS = 1 excludes this list below. I use these functions as well in my application so I'm wondering how will I be able to use them now. I'm trying to create an application with both c and c++ code.
#if !defined(MQX_SUPPRESS_STDIO_MACROS) || MQX_SUPPRESS_STDIO_MACROS == 0 
 #define clearerr _io_clearerr
 #define fclose _io_fclose
 #define feof _io_feof
 #define ferror _io_ferror
 #define fflush _io_fflush
 #define fgetc _io_fgetc
 #define fgetline _io_fgetline
 #define fgets _io_fgets
 #define fopen _io_fopen
 #define fprintf _io_fprintf
 #define fputc _io_fputc
 #define fputs _io_fputs
 #define fscanf _io_fscanf
 #define fseek _io_fseek
 #define fstatus _io_fstatus
 #define ftell _io_ftell
 #define fungetc _io_fungetc
 #define ioctl _io_ioctl 
 #define printf _io_printf
 #define putc _io_fputc
 #define read _io_read
 #define scanf _io_scanf
 #define sprintf _io_sprintf
 #define snprintf _io_snprintf
 #define sscanf _io_sscanf
 #define vprintf _io_vprintf
 #define vfprintf _io_vfprintf
 #define vsprintf _io_vsprintf
 #define vsnprintf _io_vsnprintf
 #define write _io_write
 /* fread and fwrite do not read/write chars but objects */
 #define fread(ptr,so,no,f) (_io_read(f,ptr,(so)*(no))/(so))
 #define fwrite(ptr,so,no,f) (_io_write(f,ptr,(so)*(no))/(so))
#endif
Hi Daniel,
This procedure worked but only if I use the "ARM_GCC_Support" folder and not the "ARM_EABI_Support" as mentioned in the document.
Regards,
-Mike