Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Error during compilation for NodeMCU (12.1E)

オープン
#207 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
c
領域
embedded-iot

調査の方向性

レポートで指定されている ArduinoIoTCloud の tinycbor ソース、cborpretty.c と cbortojson.c から始めます。特に、PRIx8、PRIu8、PRIu32、PRIu64 を使用している記載の行を確認してください。NodeMCU 1.0 (ESP-12E) ボード上で生成されたスケッチを使ってビルドを再現し、このコンパイラ向けにこれらのフォーマットマクロがどのように定義されているかを調べます。Arduino IoT Cloud スケッチが報告されたエラーなしでコンパイルできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

I am working on ArduinoIoTColud project and I'm using the auto-generated script from the ArduinoIotCloud.
The following error occurred during the compilation.

Code

#include "arduino_secrets.h"

_/* 
  Sketch generated by the Arduino IoT Cloud Thing 
  https://create.arduino.cc/cloud/things/

  Arduino IoT Cloud Variables description

  The following variables are automatically generated and updated when changes are made to the Thing

  CloudLight switch1;
  CloudLight switch3;
  CloudTemperatureSensor temp;
  CloudLight switch2;

  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/

#include "thingProperties.h"

void setup() {
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  delay(1500); 

  // Defined in thingProperties.h
  initProperties();

  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  
  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
 */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
}

void loop() {
  ArduinoCloud.update();
  // Your code here 
  
  
}

void onSwitch1Change() {
  // Do something
}


void onSwitch2Change() {
  // Do something
}


void onSwitch3Change() {
  // Do something
}_

Error Details

Arduino: 1.8.15 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c: In function 'hexDump':

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c:195:32: error: expected ')' before '__INT8'

  195 |         err = stream(out, "%02" PRIx8, *buffer++);

      |                                ^

      |                                )

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c: In function 'utf8EscapedDump':

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c:251:39: error: expected ')' before '__INT32'

  251 |             err = stream(out, "\\u%04" PRIX32 "\\u%04" PRIX32,

      |                                       ^

      |                                       )

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c:257:39: error: expected ')' before '__INT32'

  257 |             err = stream(out, "\\u%04" PRIX32, uc);

      |                                       ^

      |                                       )

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c: In function 'value_to_pretty':

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c:382:34: error: expected ')' before '__INT64'

  382 |             err = stream(out, "%" PRIu64, val);

      |                                  ^

      |                                  )

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c:387:39: error: expected ')' before '__INT64'

  387 |                 err = stream(out, "-%" PRIu64, val);

      |                                       ^

      |                                       )

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c:457:30: error: expected ')' before '__INT64'

  457 |         err = stream(out, "%" PRIu64 "%s(", tag, get_indicator(it, flags));

      |                              ^

      |                              )

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c:473:37: error: expected ')' before '__INT8'

  473 |         err = stream(out, "simple(%" PRIu8 ")", simple_type);

      |                                     ^

      |                                     )

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c:531:36: error: expected ')' before '__INT64'

  531 |             err = stream(out, "%s%" PRIu64 ".%s", val < 0 ? "-" : "", ival, suffix);

      |                                    ^

      |                                    )

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c: In function 'add_value_metadata':

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c:297:39: error: expected ')' before '__INT64'

  297 |         if (fprintf(out, "\"tag\":\"%" PRIu64 "\"%s", status->lastTag,

      |                                       ^

      |                                       )

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c:316:40: error: expected ')' before '__INT64'

  316 |         if (fprintf(out, ",\"v\":\"%c%" PRIx64 "\"", flags & NumberWasNegative ? '-' : '+',

      |                                        ^

      |                                        )

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c: In function 'tagged_value_to_json':

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c:351:35: error: expected ')' before '__INT64'

  351 |         if (fprintf(out, "{\"tag%" PRIu64 "\":", tag) < 0)

      |                                   ^

      |                                   )

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c:359:39: error: expected ')' before '__INT64'

  359 |             if (fprintf(out, ",\"tag%" PRIu64 "$cbor\":{", tag) < 0 ||

      |                                       ^

      |                                       )

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c: In function 'value_to_json':

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c:578:38: error: expected ')' before '__INT8'

  578 |         if (fprintf(out, "\"simple(%" PRIu8 ")\"", simple_type) < 0)

      |                                      ^

      |                                      )

C:\Users\xxx\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c:637:39: error: expected ')' before '__INT64'

  637 |                 r = fprintf(out, "%s%" PRIu64, val < 0 ? "-" : "", ival);

      |                                       ^

      |                                       )

exit status 1

Error compiling for board NodeMCU 1.0 (ESP-12E Module).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

主要言語
C
スター
632
フォーク
222
平均マージ
1日 25分
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

intel/tinycbor のほかの issue

intel/tinycbor の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。