diff --git a/arduino-core/src/processing/app/debug/Compiler.java b/arduino-core/src/processing/app/debug/Compiler.java index ad1cb914f62..1e586c58a71 100644 --- a/arduino-core/src/processing/app/debug/Compiler.java +++ b/arduino-core/src/processing/app/debug/Compiler.java @@ -396,6 +396,20 @@ public boolean compile(boolean _verbose, boolean _save) throws RunnerException, progressListener.progress(20); List includeFolders = new ArrayList(); includeFolders.add(prefs.getFile("build.core.path")); + includeFolders.add(sketchBuildFolder); + + // Create empty LibrarySettings.h file if it does not exist yet to avoid compile errors + File librarySettingsFile = new File(sketchBuildFolder, "LibrarySettings.h"); + if (librarySettingsFile.exists() == false) + { + try{ + librarySettingsFile.createNewFile(); + } + catch (IOException e) { + throw new RunnerException("Unable to create file " + librarySettingsFile); + } + } + if (prefs.getFile("build.variant.path") != null) includeFolders.add(prefs.getFile("build.variant.path")); for (UserLibrary lib : importedLibraries) {