9 years, 7 months ago.

HTTPClient コンパイルエラー

HTTPCLientライブラリをimportしてコンパイルすると"core/net.h": が無いとエラーが出ます。 一般的に使用するライブラリーをimportすればそんれに付随するファイル(xxx.h等)自動的にimport されるんではないでしょうか? 初心者ですのでよろしく御教授ください。

Error: Cannot open source input file "core/net.h": No such file or directory in "HTTPClient/LPC1768/services/http/client/HTTPClient.h", Line: 33, Col: 22

以下今回のプログラムです。

  1. include "mbed.h"
  2. include "EthernetInterface.h"
  3. include "HTTPClient.h"

EthernetInterface eth; HTTPClient http; char str[512];

int main() { eth.init(); Use DHCP

eth.connect();

PUT data strcpy(str, "99"); HTTPText outText(str); HTTPText inText(str, 512); printf("\r\nTrying to put resource...\r\n"); int ret = http.put("http://httpbin.org/put", outText, &inText); int ret = http.put("http://api.cosm.com/v2/feeds/94832/datastreams/Test.csv?key=key=atUaYYu-ofNI6CY2O< removed >aTdCclFXb3FiTT0g", outText, &inText); if (!ret) { printf("Executed PUT successfully - read %d characters\r\n", strlen(str)); printf("Result: %s\r\n", str); } else { printf("Error - ret = %d - HTTP return code = %d\r\n", ret, http.getHTTPResponseCode()); printf("Result: %s\r\n", str); }

eth.disconnect();

while(1) { } }

Be the first to answer this question.