Skip to content

Non-standard and cryptic error message when compilation fails due to no match for #include directive #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ubidefeo opened this issue Feb 25, 2021 · 1 comment
Assignees
Labels
conclusion: duplicate Has already been submitted criticality: low Of low impact

Comments

@ubidefeo
Copy link

ubidefeo commented Feb 25, 2021

Describe the bug
ne of the most common errors encountered by beginners is caused by them trying to compile a sketch they found without installing the library dependencies (all too often the sketch author doesn't even bother to document deps).
Since we don't currently bundle the standard libraries with Arduino IDE 2.0.0 (https://arduino.atlassian.net/browse/ATL-825), this is likely to be even more common.
In the Java IDE, Arduino CLI, and Arduino Web Editor, compiling a sketch with an #include directive for a non-existent header file, for example:

#include <Nonexistent.h>
void setup() {}
void loop() {}

will produce an error message that looks like this (even without verbose compilation output enabled):

C:\program-files\arduino\cli\arduino-cli_nightly\Foo\Foo.ino:1:10: fatal error: Nonexistent.h: No such file or directory
 #include <Nonexistent.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
Error during build: exit status 1

This is all you get with the default non-verbose compilation output setting:

Compilation error: Error: 2 UNKNOWN: exit status 1

The verbose compilation output is still pretty cryptic

Alternatives for Nonexistent.h: []
ResolveLibrary(Nonexistent.h)
  -> candidates: []
Compilation error: Error: 2 UNKNOWN: exit status 1

You're not going to find many helpful results if you Google these strings, whereas there are zillions for "No such file or directory".
The Java IDE and Arduino Web Editor also highlight the line of the sketch associated with the error:

Clipboard01

while Arduino IDE 2.0.0 gives no indication of the source of the error.

Desktop (please complete the following information):

  • OS: Windows 10
  • Version: 2.0.0-beta.2-snapshot.298cc11
  • CLI Version: 0.16.0 alpha [c977a238]

[ originally reported by @per1234 ]

@ubidefeo ubidefeo added type: bug priority: medium Resolution is a medium priority labels Feb 25, 2021
@rsora rsora added priority: low Resolution is a low priority and removed priority: medium Resolution is a medium priority labels Mar 1, 2021
@per1234
Copy link
Contributor

per1234 commented May 16, 2021

Even though this came first, I'll close it in favor of the duplicate https://github.com/arduino/arduino-ide/issues/249, which discusses technical details.

@per1234 per1234 closed this as completed May 16, 2021
@per1234 per1234 added the conclusion: duplicate Has already been submitted label May 16, 2021
@rsora rsora added the type: imperfection Perceived defect in any part of project label Sep 22, 2021
@rsora rsora added criticality: low Of low impact and removed priority: low Resolution is a low priority type: imperfection Perceived defect in any part of project labels Nov 2, 2021
@per1234 per1234 self-assigned this Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: duplicate Has already been submitted criticality: low Of low impact
Projects
None yet
Development

No branches or pull requests

3 participants