2022-11-01から1ヶ月間の記事一覧

Debian/Raspbianのバージョン情報

Linuxの情報 $ uname -a Linux raspberrypi 5.10.103-v7+ #1529 SMP Tue Mar 8 12:21:37 GMT 2022 armv7l GNU/Linux Debian/Raspbianのバージョン $ cat /etc/debian_version 10.13 $ cat /etc/issue Raspbian GNU/Linux 10 \n \l ディストリビューション情…

gcc/g++の定義済みマクロ(predefined macros)の一覧

$ gcc -dM -E - < /dev/null g++でも同じ。 [GCC][C/C++][Linux] GCCの定義済みマクロ(predefined macros)のダンプ - Qiita

warning: implicit declaration of function ‘i2c_smbus_write_byte_data’

とあるi2cを使うcコードでコンパイル警告とリンクエラーが出た。 コンパイル警告 warning: implicit declaration of function ‘i2c_smbus_write_byte_data’ warning: implicit declaration of function ‘i2c_smbus_read_byte’ リンクエラー undefined refere…

error: variable ‘std::istringstream in’ has initializer but incomplete type

何エラーか良くわからんかったが、どうやら std::istringstreamを使うには<sstream>が必要、ということだった。 ヘッダをインクルードしたら解決した。 error: variable ‘std::istringstream in’ has initializer but incomplete type std::istringstream hoge(fuga);</sstream>…

特定ユーザーでsudoを使えるようにする

(Debian 10 busterで確認) //rootに移行 $ su rootのパスワード //sudoを入れる # apt-get install sudo //特定ユーザーを追加する # visudo > ユーザー名 ALL=(ALL:ALL) ALL ctrl+x で保存 //使えるよになったか確認する # exit $ sudo -v

wiringPiの手動インストール

公式は開発終了、有志により継続中。公式の最終版は2.50 (Raspberry Pi OS 10 busterまでならパッケージがあるのでそちらを使え) git clone \ https://github.com/WiringPi/WiringPi.git \ -b final_official_2.50 cd WiringPi ./build github.com

googletestのインストール

バージョンは適宜。mock不要、インストール先指定で。 git clone https://github.com/google/googletest.git -b release-1.12.0 cd googletest mkdir build cd build cmake .. \ -DBUILD_GMOCK=OFF \ -DCMAKE_INSTALL_PREFIX:PATH=/path/to/deploy make make…