Visual C++ for linux Developmentで、RaspberryPiのデバッグ。
Visual C++ for linux Development
のインストールは、前の記事の見てください。
# ビルドは、RaspberryPi本体で行われるようですね。
環境
- Windows 10 (64bit)
- Visual Studio 2015 Update 2 (Enterprise) 全部入りでインストール。
- Raspberry Pi 2 (model B)
- Raspbian: Jessie-Lite (2016-03-18-raspbian-jessie-lite.img)
準備: RaspberryPi
- Raspbianイメージをお好みのツールで、microSDへ書き込み。
-
初期設定
sudo apt-get update sudo apt-get upgrade sudo raspi-config
で、この辺↓を設定して、
> 2 Change User Password
> 5 Internationalisation Options>I2 Change Timezone
> 1 Expand Filesystem
> 9 Advanced Options>A2 Hostname
=> 再起動 VC for Linux-devで入れろといわれてるパッケージ類
sudo apt-get install -y openssh-server g++ gdb gdbserver
=> (すでに最新版が入ってました)お好みのパッケージ
sudo apt-get install -y byobu htop ccze
VS2015: Getting Started
- プロジェクト作成
- RaspPiへの接続設定
-
ビルド・デバッガ
- main.cppタブを選択して、
- wiringPiSetupSys();の行のあたりにカーソルを持ってきて、[F9]で●赤丸つけて(ブレークポイントを張って)、
- [F5]を押す。ビルドしますか => [はい(Y)]
- ビルドエラーが発生しました。 ... ぉ?
- => [いいえ(N)]
-
wiringPi.h: No such file or directory
=> wiringPi.hがない? -
RaspberryPi側で、wiringpiパッケージをインストール
pi@raspberrypi:~ $ sudo apt-get install wiringpi Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: wiringpi 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 43.9 kB of archives. After this operation, 0 B of additional disk space will be used. Get:1 http://archive.raspberrypi.org/debian/ jessie/main wiringpi armhf 2.32 [43.9 kB] Fetched 43.9 kB in 0s (58.3 kB/s) Selecting previously unselected package wiringpi. (Reading database ... 30851 files and directories currently installed.) Preparing to unpack .../wiringpi_2.32_armhf.deb ... Unpacking wiringpi (2.32) ... Setting up wiringpi (2.32) ... Processing triggers for libc-bin (2.19-18+deb8u3) ... pi@raspberrypi:~ $
[F5]で、再度ビルド 。