2013-01-07 29 views
1

我試圖做出簡單的網絡服務器,所以如果我搜索我的瀏覽器並輸入我的設備的IP地址,我看到一個網頁。我發現this維客頁面lwip網絡服務器(Cortex M3,Stellaris LM3S6965評估板)

我已經按照步驟操作,但是在創建時出錯。

我有包括鏈接的文件夾"C:\stellarisware\third_party\lwip-1.3.2\apps\httpserver_raw"得到httpd.c,等我加httpd_init()文件

,但同時建立我得到這個錯誤。

[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 

如果我看的文件,這是它:

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}}; 

這是我的DIR什麼樣子:

enter image description here

這裏距離是源文件網絡服務器:download

這裏是我的main.c,在線270上,我調用了httpd_init(); Download

+0

你需要展示更多的代碼,也許也是makefile或者你正在構建它。儘管如此,這裏的邊界太大/具體可以回答。 – unwind

+0

我編輯了它,但我也認爲makefile生成要顯示的文件。但我可以在哪裏更改,以便顯示我輸入的HTML頁面。 – Sharpless512

+1

編譯器告訴你它不知道'struct's是什麼樣子,因爲它們的定義在你的數組所在的代碼中是不可見的。可能你需要「包含」更多的東西。 – Spudd86

回答

2

您需要從構建中排除fsdata.c:右鍵單擊文件 - >資源配置 - >從構建排除 - >全選。

這個文件是自動生成的,並且在fs.c IIRC中有一個#include "fsdata.c"的聲明。在這種情況下,.c擴展名有點誤導 - 它是一個C源文件,但不能單獨編譯,只能作爲具有所有定義和#include行的另一個文件的一部分。