4/5/2017 3:00 PM | |
Posts: 1 Rating: (0) |
Hello! I am using eclipse to develop IoT. I wanted to test UDP socket to connnect our own equipment. Now, I have a problem in this line. -------------------------------- recvfrom(socket_handle,UdpRcvMsg,sizeof(UdpRcvMsg),0,(struct sockaddr *)&sin,(socklen_t*)&sin_len); -------------------------------- The error message is : Invalid arguments ' Candidates are: int recvfrom(int, void *, ?, int, sockaddr *, unsigned int *) ' The prototype of recvfrom is: extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len); I baidu this question(I cann't use google in China). it means "size_t" is Invalid. To solve this problem, I tried: step 1 add <stddef.h> into this project. --- not work add <cstddef> into this project. --- not work step 2 Properties for Project -->c/c++ General --> Preprocessor inculde Paths...-->Providers-->"check CDT GCC Built-in Compiler Settings" --- not work I hope that someone can help me. Best regards! AttachmentUdpSocketTest.zip (245 Downloads) |
7/7/2017 9:43 PM | |
Posts: 10 Rating: (0) |
I have it working by adding : "${POKY_HOME}/usr/lib/gcc/i586-poky-linux/5.3.0/include" in properties->c/c++Build->settings->tools settings->iot2000 c++ compiler |
Follow us on