1

単純なWebサーバーを作成しようとしているので、ブラウザーで検索してデバイスのIPを入力すると、Webページが表示されます。このwikiページを見つけました

手順に従いましたが、ビルド中にエラーが発生しました。

"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がどのように見えるかです:

ここに画像の説明を入力してください

Webサーバーからのソースファイルは次のとおりです。ダウンロード

これが私のmain.cです。270行目でhttpd_init()を呼び出しました。ダウンロード

4

1 に答える 1

2

ビルドから除外する必要がありますfsdata.c: ファイルを右クリック -> リソース構成 -> ビルドから除外 -> すべてを選択します。

このファイルは自動生成され、 IIRCに#include "fsdata.c"ステートメントがあります。fs.cこの.c場合、拡張子は少し誤解を招きます。これはCソース ファイルですが、すべての定義と#include行を含む別のファイルの一部としてのみ、単独でコンパイルすることはできません。

于 2013-01-08T09:46:48.897 に答える