質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
C

C言語は、1972年にAT&Tベル研究所の、デニス・リッチーが主体となって作成したプログラミング言語です。 B言語の後継言語として開発されたことからC言語と命名。そのため、表記法などはB言語やALGOLに近いとされています。 Cの拡張版であるC++言語とともに、現在世界中でもっとも普及されているプログラミング言語です。

IDE

IDE、統合開発環境((Integrated Development Environment)とは、テキストエディタ以上の機能を提供して、ソフトウェア開発を効率をあげるコンピュータプログラムを指す。

コンパイルエラー

コンパイルのフェーズで生成されるエラーです。よく無効なシンタックスやタイプが含まれているとき発生します。

C++

C++はC言語をもとにしてつくられた最もよく使われるマルチパラダイムプログラミング言語の1つです。オブジェクト指向、ジェネリック、命令型など広く対応しており、多目的に使用されています。

Arduino

Arduinoは、AVRマイコン、単純なI/O(入出力)ポートを備えた基板、C言語を元としたArduinoのプログラム言語と、それを実装した統合開発環境から構成されたシステムです。

Q&A

解決済

1回答

3733閲覧

Arduino IDEでコンパイル時にfatal error: bits/error_constants.h: No such file or directoryが出てしまう

kalon

総合スコア198

C

C言語は、1972年にAT&Tベル研究所の、デニス・リッチーが主体となって作成したプログラミング言語です。 B言語の後継言語として開発されたことからC言語と命名。そのため、表記法などはB言語やALGOLに近いとされています。 Cの拡張版であるC++言語とともに、現在世界中でもっとも普及されているプログラミング言語です。

IDE

IDE、統合開発環境((Integrated Development Environment)とは、テキストエディタ以上の機能を提供して、ソフトウェア開発を効率をあげるコンピュータプログラムを指す。

コンパイルエラー

コンパイルのフェーズで生成されるエラーです。よく無効なシンタックスやタイプが含まれているとき発生します。

C++

C++はC言語をもとにしてつくられた最もよく使われるマルチパラダイムプログラミング言語の1つです。オブジェクト指向、ジェネリック、命令型など広く対応しており、多目的に使用されています。

Arduino

Arduinoは、AVRマイコン、単純なI/O(入出力)ポートを備えた基板、C言語を元としたArduinoのプログラム言語と、それを実装した統合開発環境から構成されたシステムです。

0グッド

0クリップ

投稿2020/11/19 00:17

編集2020/11/19 00:36

前提・実現したいこと

fatal error: bits/error_constants.h: No such file or directory
を解決して、Arduino IDEからM5stickCに書き込めるようにしたい。

発生している問題・エラーメッセージ

In file included from c:\users\aki_f\dropbox\my pc (laptop-q40lrgpt)\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\ios_base.h:46:0, from c:\users\aki_f\dropbox\my pc (laptop-q40lrgpt)\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\ios:42, from c:\users\aki_f\dropbox\my pc (laptop-q40lrgpt)\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\istream:38, from c:\users\aki_f\dropbox\my pc (laptop-q40lrgpt)\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\sstream:38, from C:\Users\aki_f\Dropbox\My PC (LAPTOP-Q40LRGPT)\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.4\libraries\BLE\src\BLEAddress.cpp:12: c:\users\aki_f\dropbox\my pc (laptop-q40lrgpt)\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\system_error:39:34: fatal error: bits/error_constants.h: No such file or directory compilation terminated. exit status 1 ボードM5Stick-Cに対するコンパイル時にエラーが発生しました。

該当のソースコード

Arudino

1#include <M5StickC.h> 2#include <BleKeyboard.h> 3 4BleKeyboard bleKeyboard; 5 6enum ConfSystem { 7 zoom = 0, 8 webex 9} conf; 10int n_conf = 2; 11bool on_air; 12 13void setup() { 14 M5.begin(); 15 bleKeyboard.begin(); 16 17 Serial.println("Webconf Mute button"); 18 Serial.println("Push Button A (M5) to toggle MUTE"); 19 Serial.println("Push Button B to switch Zoom or WebEx"); 20 M5.Lcd.setRotation(3); // BtnA is left side to LCD 21 22 // default 23 conf = zoom; 24 on_air = true; 25 update_display(); 26} 27 28void loop() { 29 M5.update(); 30 31 if(M5.BtnA.wasPressed()){ 32 Serial.println("BtnA was pressed"); 33 if(bleKeyboard.isConnected()){ 34 on_air = !on_air; 35 if(conf==zoom){ 36 send_mute_zoom(); 37 } 38 else if(conf==webex){ 39 send_mute_webex(); 40 } 41 } 42 else { 43 Serial.println("BLE is not connected"); 44 } 45 update_display(); 46 } 47 48 if(M5.BtnB.wasPressed()){ 49 Serial.println("BtnB was pressed"); 50 conf = ConfSystem((conf+1) % n_conf); 51 Serial.print("New ConfSystem: "); 52 Serial.println(conf); 53 update_display(); 54 } 55 delay(10); 56} 57 58void update_display(){ 59 Serial.println("update_display"); 60 Serial.print("On air?: "); 61 Serial.println(on_air); 62 if(on_air){ 63 show_onair(); 64 } 65 else { 66 show_inmute(); 67 } 68} 69 70void show_onair(){ 71 M5.Lcd.fillScreen(TFT_RED); 72 M5.Lcd.setTextColor(TFT_WHITE, TFT_RED); 73 M5.Lcd.setTextSize(3); 74 M5.Lcd.setTextDatum(MC_DATUM); 75 M5.Lcd.drawString("ON AIR",80,40); 76 77 M5.Lcd.setTextSize(2); 78 M5.Lcd.setTextDatum(BR_DATUM); 79 if(conf==zoom){ 80 M5.Lcd.drawString("ZOOM",158,78); 81 } 82 else if (conf==webex){ 83 M5.Lcd.drawString("WebEx", 158,78); 84 } 85} 86 87void show_inmute(){ 88 M5.Lcd.fillScreen(TFT_DARKGREY); 89 M5.Lcd.setTextColor(TFT_WHITE, TFT_DARKGREY); 90 M5.Lcd.setTextSize(3); 91 M5.Lcd.setTextDatum(MC_DATUM); 92 M5.Lcd.drawString("Muted...",80,40); 93 94 M5.Lcd.setTextSize(2); 95 M5.Lcd.setTextDatum(BR_DATUM); 96 if(conf==zoom){ 97 M5.Lcd.drawString("ZOOM",158,78); 98 } 99 else if (conf==webex){ 100 M5.Lcd.drawString("WebEx", 158,78); 101 } 102} 103 104void send_mute_zoom(){ 105 // https://support.zoom.us/hc/en-us/articles/205683899-Hot-Keys-and-Keyboard-Shortcuts-for-Zoom 106 // Command(⌘)+Shift+A: Mute/unmute audio 107 Serial.println("Toggle mute on zoom"); 108 //bleKeyboard.press(KEY_LEFT_GUI); 109 bleKeyboard.press(KEY_LEFT_ALT); 110 bleKeyboard.press(65); // "A" 111 delay(100); 112 bleKeyboard.releaseAll(); 113} 114 115void send_mute_webex(){ 116 // https://www.cisco.com/c/en/us/td/docs/collaboration/CWMS/2_5/b_manage_meetings/b_manage_meetings_chapter_0100.html 117 // Ctrl+M Mute or unmute yourself 118 Serial.println("Toggle mute on WebEx"); 119 //bleKeyboard.press(KEY_LEFT_CTRL); 120 bleKeyboard.press(KEY_LEFT_GUI); 121 //bleKeyboard.press(KEY_LEFT_SHIFT); 122 bleKeyboard.press(77); // "M" 123 delay(100); 124 bleKeyboard.releaseAll(); 125}

試したこと

ググりましたが、同様のエラーが発生したというウェブサイトがないのでお手上げになってしまいました。アドバイスをよろしくお願いいたします。

補足情報(FW/ツールのバージョンなど)

Arduino IDE 1.8.42.0
M5Stick C
Windows10

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

fatal error:bits/error_constants.h:No such file or dictionary
というエラーは、なんらかの必要なファイル類が不足している場合に発生します。今回で言えば、bits/error_constans.hが見当たらないようです。
そのファイルが手元に(標準ヘッダーっぽいので標準ヘッダーがあるフォルダを確認してください)あるなら、IDEの方でパスを確認してください。
探しても見当たらない場合は、そのヘッダーを自分で用意してください。

投稿2020/11/19 05:00

legohasiri

総合スコア40

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

kalon

2020/11/19 05:29

c:\users\aki_f\dropbox\my pc (laptop-q40lrgpt)\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\ こちらに、error_constants.hと、そのほか必要なファイルを入れたところ、コンパイルが通るようになりました。ありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問