IDE 2 (beta) - problem

I have a simple sketch using an RTC (DS3231) . Compiles and runs fine with IDE 1. Downloaded IDE 2 (beta), rebooted, and A) lots of keywords ( e.g. "serial" and keywords from included libraries) are marked with red underline, B) compiling yields the informative message "Compilation error: Error: 13 INTERNAL: exit status 1". I'll post code if anyone wants, but seems a bit pointless.

Help, please!

Your post was MOVED to its current location as it is more suitable.

Hi @johndg. Thanks for giving the beta phase Arduino IDE 2.x a try and proving your valuable feedback!

There are a lot of known issues with the Arduino Language Server that generates these underlines. You can see the list currently tracked by the IDE developers here:

https://github.com/arduino/arduino-ide/issues?q=is%3Aissue+is%3Aopen+label%3A"topic%3A+language+server"+label%3A"type%3A+imperfection"

The important thing to understand is that this is a different system from the one that compiles your code. As long as you can successfully compile, then the code is valid.

Just today, the developers made a nice improvement to the error messages to make them less cryptic;

Let's start with the full output. There is probably additional valuable information that will help us to identify the problem.

Please do this:

  1. Right click on the black "Output" pane at the bottom of the Arduino IDE 2.x window.
  2. From the context menu, click Copy All.
  3. Open a forum reply here by clicking the Reply button.
  4. Click the </> icon on the post composer toolbar. This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code block
  5. Press Ctrl+V. This will paste the compilation output into the code block.
  6. Move the cursor outside of the code tags before you add any additional text to your reply.
  7. Click the Reply button to post the output.

Had very little output, but just turned on 'verbose' output, and got this:

Using board 'nano' from platform in folder: C:\Users\johnd\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3
Using core 'arduino' from platform in folder: C:\Users\johnd\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3
Detecting libraries used...
"C:\\Users\\johnd\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Users\\johnd\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\johnd\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\eightanaloginputs" "C:\\Users\\johnd\\AppData\\Local\\Temp\\arduino-sketch-E9D74672EDC10F09C71BF9973FC2995C\\sketch\\clock_rtc_only_1.ino.cpp" -o nul
Alternatives for Wire.h: [Wire@1.0]
ResolveLibrary(Wire.h)
  -> candidates: [Wire@1.0]
"C:\\Users\\johnd\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Users\\johnd\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\johnd\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\eightanaloginputs" "-IC:\\Users\\johnd\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\libraries\\Wire\\src" "C:\\Users\\johnd\\AppData\\Local\\Temp\\arduino-sketch-E9D74672EDC10F09C71BF9973FC2995C\\sketch\\clock_rtc_only_1.ino.cpp" -o nul
Alternatives for RtcDS3231.h: []
ResolveLibrary(RtcDS3231.h)
  -> candidates: []
Using library Wire at version 1.0 in folder: C:\Users\johnd\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3\libraries\Wire 
Compilation error: Error: 13 INTERNAL: exit status 1

Great!

This is currently the Arduino IDE 2.x cryptic equivalent of the more intuitive "No such file or directory" error you have probably encountered when using the classic Arduino IDE.

The bug that caused the error message to be so strange has already been fixed, and so this will be a better experience on the next release of Arduino IDE 2.x:


This error almost always means you need to install the library that contains the missing file.

Often the code you're compiling will come with documentation (either a comment or separate document) that tells you where to get the library dependencies.

Note that libraries may have dependencies on other libraries.

In other cases the author of the code will not have been so kind and you'll need to go on a hunt for the missing library.

A good place to start is the Arduino IDE's Library Manager:

  1. Select Sketch > Include Library > Manage Libraries... from the Arduino IDE's menus.
  2. In the "Filter your search..." box, type some keywords you have gleaned from the missing file name.
  3. Scroll through the results for the right library. Click on it.
  4. Click the Install button.
  5. Wait for the installation to finish.
  6. Try compiling your code again.

If you have no luck in Library Manager then load up your favorite search engine and do a search for the missing filename. You will often get multiple results. If you have a lot of results you might add "arduino" as an additional search keyword. I will usually prefer results from github.com since that is where most Arduino libraries are hosted and downloading from there is fast and easy. In some cases there will be multiple libraries that contain the given filename and you'll need to do some evaluation to determine which seems the most appropriate, then try it out.

After downloading the library you found, you'll need to install it. This requires a different process than the Library Manager installation. You will find instructions here:

As for this, it might be that you have a different sketchbook setting in each of the Arduino IDEs. Arduino IDE 2.x has a different preferences storage system than the classic Arduino IDE, so any custom settings you configured in the classic Arduino IDE preferences are not automatically transferred to Arduino IDE 2.x.

Libraries are installed to your sketchbook folder, so if you have a different sketchbook folder then the libraries installed by one IDE will not be available in the other.

You can check the sketchbook folder location by opening File > Preferences from the Arduino IDE menus and then checking the "Sketchbook location" setting.

1 Like

But it compiles and runs with IDE 1 ! No missing files etc. ?

Check my latest reply. If that doesn't solve it, let me know and I'll help with the investigation to find the real cause.

After a bit of buggering around with pathnames (I hate Win 10! And I didn't ask for OneDrive. Bring back XP!) - it seems to have compiled. I'll come back if there are any more problems.
Many thanks,
John.

FYI - also downloads and runs! Thanks again.

But somewhere along the way you said "yes" to it, as did I, but it confused me so much as to where my files really were that I turned it off

Good idea!

I didn't ask for OneDrive. Bring back XP!

Hear, hear!

somewhere along the way you said "yes" to it, as did I

I have learned from hard experience that installing Windows is like walking through a minefield. If you can manage to make it through without accidentally signing up for a Microsoft account and enabling OneDrive and Cortana and Windows Store and Xbox Live and on and on and on, the OS itself really isn't so bad.

That is, after I have spent two full days combing through every setting and registry hack to make it work something like my Window 7 installation, which I had done my best to make work something like my XP installation, which I had done my best to make work like my Windows 95 installation, which I had done my best to make work like my Windows 3.1 installation. So I'm not actually sure what the model is I'm shooting for anymore, but it sure is nothing like the stock installation.

1 Like