LoginSignup
5
0

More than 5 years have passed since last update.

[Arduino] Windowsで突然コンパイルエラー。(readlink ...The system cannot find the file specified ...Error compiling...)

Last updated at Posted at 2018-04-16

やりたいこと

以下の環境で発生するコンパイルエラーを直したい

OS : Windows 10 Pro (OS Build 16299.371)  
Arduino IDE : 1.8.5  
スケッチパス : (インストール時のデフォルト)   
Board : Arduino Uno R3

現象

2カ月くらい前には正常に動いていた Arduino IDE で、
突然コンパイルエラーが発生するようになった。
以下のようなエラーメッセージが出る。

readlink C:\Users\goshi\OneDrive\Documents\Arduino\harware: The system cannot find the file specified.
Error compiling for board Arduino/Genuino Uno.

解決策

以下の情報によると、どうやら、Arduino IDEインストール時に自動で設定されたスケッチ保存ディレクトリのパス OneDrive が怪しい様子。

Compilation fails with OneDrive / "Cloud reparse points" #254
(最近のWindows 10のバージョンとOneDriveを組み合わせると、arduino-builderがファイルを読み取れないという問題が発生といった内容)

現時点では、OneDriveを使用する必要はないので、
スケッチ保存ディレクトリを変更して対応。

- スケッチの保存ディレクトリの場所を確認
    Arduino IDE : File ->Preferences -> settings -> sketchbook location 

- スケッチ保存ディレクトリの移動
    OneDrive 配下ではない任意の場所に移動

- スケッチ保存ディレクトリの場所を再設定 
    Arduino IDE の sketchbook location の設定を変更する  

- IDEを再起動

これで無事にコンパイルが通るようになった。

なお、OneDriveを無効にする場合は次のリンクを参考にするとよいかもしれない。
Windows 10でOneDriveを無効・フォルダ場所変更・同期停止する方法

注意

最初、Arduino 1.8.5 (Windows Store 1.8.10.0)を使っていたが、
スケッチの保存場所を変更しても、再起動のたびに、
再度、OneDrive直下にディレクトリが作成されてしまう謎の現象が発生。

file->preferences->settings に記載のある、preference.txtのパスが、
通常インストールだと、/AppData/Local に設定されるはずが、
/OneDrive 配下になっているのが怪しい。
あまり深追いせず、スケッチ保存場所を退避してから、
Windows Storeの Arduino IDE はアンインストールし、
通常のインストーラーでインストールし直し、上記の解決策を試した。

5
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
0