I'm trying to make simple webserver so if I search on my browser and enter the ip of my device I see a webpage. I found this wiki page
I have followed the steps, but I have an error while building.
I have includes the linked folder "C:\stellarisware\third_party\lwip-1.3.2\apps\httpserver_raw"
to get the httpd.c, etc files
I added httpd_init()
but while building I get this error.
[cc] C:\stellarisware\third_party\lwip-1.3.2\apps\httpserver_raw\fsdata.c:328:26: error: array type has incomplete element type
[cc] C:\stellarisware\third_party\lwip-1.3.2\apps\httpserver_raw\fsdata.c:330:26: error: array type has incomplete element type
[cc] C:\stellarisware\third_party\lwip-1.3.2\apps\httpserver_raw\fsdata.c:332:26: error: array type has incomplete element type
If I look at that files, this is in it:
const struct fsdata_file file_img_sics_gif[] = {{NULL, data_img_sics_gif, data_img_sics_gif + 14, sizeof(data_img_sics_gif) - 14}};
const struct fsdata_file file_404_html[] = {{file_img_sics_gif, data_404_html, data_404_html + 10, sizeof(data_404_html) - 10}};
const struct fsdata_file file_index_html[] = {{file_404_html, data_index_html, data_index_html + 12, sizeof(data_index_html) - 12}};
This is how my dir look like:
Here are the source files from the webserver: download
And here is my main.c, on line 270 I called the httpd_init(); Download
You need to exclude fsdata.c
from build: Right Click on the file -> Resource Configurations -> Exclude from Build -> Select All.
This file is auto-generated, and there is an #include "fsdata.c"
statement in fs.c
IIRC. The .c
extension is a bit misleading in this case - it is a C
source file but cannot be compiled alone, only as part of another file which has all the definitions and #include
lines.