Error in building Free RTOS demo project for Xilinx Zynq-7000 (dual core ARM Cortex-A9) SoC Port

Hello Team, I tried to build the demo project for Zynq ZC702 board in Xilinx SDK. And I encountered the following error: ./src/lwIPDemo/lwIPApps/apps/httpserverrawfromlwIPdownload/httpd.c:375:1: error: static declaration of ‘strnstr’ follows non-static declaration and so the build failed with following error: src/lwIPDemo/lwIPApps/apps/httpserverrawfromlwIPdownload/subdir.mk:21: recipe for target ‘src/lwIPDemo/lwIPApps/apps/httpserverrawfromlwIPdownload/httpd.o’ failed I just tried to remove the keyword “static” for strnstr function in httpd.c file and compiled again , it was successful.So I am not sure of what exactly is causing this error. And furthermore I set the macro **mainSELECTED_APPLICATION **to 0, to build Blinky project,so what is the necessity for the build to take IwIP files for compilation(I am not sure of the background details as I am new to FreeRTOS). Any help to give a better undertanding is welcome!! Link to other threads dealing with the same error will be helpful!! Thanks in Advance!! Regards, Varun Rajasekaran

Error in building Free RTOS demo project for Xilinx Zynq-7000 (dual core ARM Cortex-A9) SoC Port

Hello Team, when I tried to find the root cause for it,I came across the following. The function is declared with the following prototype in string.h file in the compiler: #if BSDVISIBLE char *strnstr(const char *, const char *, sizet) _pure; And string.h has been included in the httpd.c file and has been declared as static as follows: #if LWIPHTTPDSTRNSTRPRIVATE / Like strstr but does not need ‘buffer’ to be NULL-terminated */ static char* strnstr(const char* buffer, const char* token, sizet n) {…} So the error mentioned in the above post occurs everytime the demo project is compiled. So what exactly should be done to avoid the error? Is it fine to remove the static keyword and proceed with the compilation? Or is there any other right justification? Regards, Varun Rajasekaran

Error in building Free RTOS demo project for Xilinx Zynq-7000 (dual core ARM Cortex-A9) SoC Port

I have never seen this issue. Are you building as C++ as I’ve only ever built as C. Don’t see a problem with removing static qualifier other than normally we prefer not to update third party files.

Error in building Free RTOS demo project for Xilinx Zynq-7000 (dual core ARM Cortex-A9) SoC Port

Hello Richard, Thanks for your reply!! I just followed the steps as mentioned in the https://www.freertos.org/RTOS-Xilinx-Zynq.html . So I am really not sure by what you are referring to building as C++. I have not made any changes to the file format too. Kindly clarify!! Regards, Varun Rajasekaran

Error in building Free RTOS demo project for Xilinx Zynq-7000 (dual core ARM Cortex-A9) SoC Port

Hi Varun, the error message that you encounter comes from third-party sources files, from lwIP. When I google for “lwIP httpd.c”, I hit upon a source file that makes heavy use of a function or a macro called lwip_strnstr. Can you “grep” in your source tree for all occasions of “strnstr” or “lwip_strnstr”? I’m sure that you will find the answer to your question when doing so.

Error in building Free RTOS demo project for Xilinx Zynq-7000 (dual core ARM Cortex-A9) SoC Port

Hm, sorry, I hadn’t read your second message, only the first and the last. It looks like you have to define either LWIP_HTTPD_STRNSTR_PRIVATE or BSD_VISIBLE, depending on whether the standard strnstr() is available. But once again, this is not a problem related to AWS/FreeRTOS.