IDE 2.0.0-RC7 strange compiler issues

My own sketch looked correct, but was failing to compile. So I decided to try compiling the Blink sketch out of Examples. Here's the compiler output:

C:\Users\George\AppData\Local\Temp\ccVT0ixY.ltrans0.ltrans.o: In function setup': C:\Users\George\AppData\Local\Temp\.arduinoIDE-unsaved2022510-16684-1874d7d.kuc9\Blink/Blink.ino:28: undefined reference to pinMode'
C:\Users\George\AppData\Local\Temp\ccVT0ixY.ltrans0.ltrans.o: In function loop': C:\Users\George\AppData\Local\Temp\.arduinoIDE-unsaved2022510-16684-1874d7d.kuc9\Blink/Blink.ino:33: undefined reference to digitalWrite'
C:\Users\George\AppData\Local\Temp.arduinoIDE-unsaved2022510-16684-1874d7d.kuc9\Blink/Blink.ino:35: undefined reference to `digitalWrite'
collect2.exe: error: ld returned 1 exit status

Compilation error: exit status 1

Can anyone advise? This looks like a type of installation error, but I'm not sure what to do about it. RC-6 was just fine in this regard.

How can I revert to rc-6?

George

@G3750, your topic has been moved to the dedicated IDE 2.0 beta section of the forum.

Did you do a full install or did you install from ZIP. I'm using the ZIP and can't reproduce your issue.

I think I clicked on a link at the bottom of IDE (a pop-up screen) that invited me to go to rc-7. I’m running Windows 10. Can I just uninstall this version of the IDE (from Control Panel or whatever its called in this version) and still retain my files? I seem to be able to see files and compile correctly from 1.8x.

Thanks,

George

If files means sketches, just make a backup to be safe. You might want to back up the used libraries as well (so you have the same ones / versions if you want to recompile an existing sketch again).

After that you should be able to safely uninstall.

You might want to check if you have a directory C:\Users\George\AppData\Local\Arduino15 and delete that for a complete uninstall; again, make a backup just in case.

Hi @G3750

At this time, the "Software" page on Arduino's website only lists the download links for the latest version of Arduino IDE 2.x. However, you can get the download links for Arduino IDE 2.0.0-rc6 from the "Assets" section of this page on the Arduino IDE 2.x development repository:

https://github.com/arduino/arduino-ide/releases/tag/2.0.0-rc6#:~:text=Assets

I would like to tell you that there have been some very significant advancements in the 2.0.0-rc7 release. If you would like to try to get 2.0.0-rc7 working instead of going back to 2.0.0-rc6, I would be happy to help you out with that.

Yes.

I’d be willing to try to get 2.0.0-rc7 working again but I absolutely need to preserve the sketches (files) I’ve built so far.

Thanks,

George

Then you must implement an effective backup strategy. If your sketches are not backed up, they are never safe, regardless of what you do with the Arduino IDE.

Data loss can happen at any time, through many different ways (e.g., hard drive crash, malware, stolen computer, house fire). If you don't back up your irreplaceable data, data loss is not a matter of "if", but of "when".

OK, let's go.

I'm going to ask you to post some additional information I need to provide you with the instructions for fixing the issue.

:exclamation: NOTE: These instructions will not solve the problem. They are only intended to gather more information about the problem.

Please do this:

  1. Start the Arduino IDE 2.0.0-rc7 if it is not already running.
  2. Select File > Preferences from the Arduino IDE menus.
  3. Check the box next to "Show verbose output during: ☐ compilation".
  4. Click the OK button.
  5. Select Sketch > Verify/Compile from the Arduino IDE menus.
  6. Wait for the compilation to fail.
  7. Right click on the black "Output" pane at the bottom of the Arduino IDE 2.x window.
  8. From the context menu, click Copy All.
  9. Open a forum reply here by clicking the Reply button.
  10. 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
  11. Press Ctrl+V.
    This will paste the compilation output into the code block.
  12. Move the cursor outside of the code tags before you add any additional text to your reply.
  13. Click the Reply button to post the output.
Using board 'uno' from platform in folder: C:\Users\George\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5
Using core 'arduino' from platform in folder: C:\Users\George\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5
Detecting libraries used...
"C:\\Users\\George\\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_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\George\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.5\\cores\\arduino" "-IC:\\Users\\George\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.5\\variants\\standard" "C:\\Users\\George\\AppData\\Local\\Temp\\arduino-sketch-EA59513BCA9A74522C9CC1275535FE56\\sketch\\LEDtest001.ino.cpp" -o nul
Alternatives for SchedTask.h: [SchedTask@1.1.4]
ResolveLibrary(SchedTask.h)
  -> candidates: [SchedTask@1.1.4]
"C:\\Users\\George\\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_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\George\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.5\\cores\\arduino" "-IC:\\Users\\George\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.5\\variants\\standard" "-IC:\\Users\\George\\Documents\\Arduino\\libraries\\SchedTask\\src" "C:\\Users\\George\\AppData\\Local\\Temp\\arduino-sketch-EA59513BCA9A74522C9CC1275535FE56\\sketch\\LEDtest001.ino.cpp" -o nul
Using cached library dependencies for file: C:\Users\George\Documents\Arduino\libraries\SchedTask\src\SchedBase.cpp
Using cached library dependencies for file: C:\Users\George\Documents\Arduino\libraries\SchedTask\src\SchedTask.cpp
Generating function prototypes...
"C:\\Users\\George\\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_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\George\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.5\\cores\\arduino" "-IC:\\Users\\George\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.5\\variants\\standard" "-IC:\\Users\\George\\Documents\\Arduino\\libraries\\SchedTask\\src" "C:\\Users\\George\\AppData\\Local\\Temp\\arduino-sketch-EA59513BCA9A74522C9CC1275535FE56\\sketch\\LEDtest001.ino.cpp" -o "C:\\Users\\George\\AppData\\Local\\Temp\\arduino-sketch-EA59513BCA9A74522C9CC1275535FE56\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"C:\\Users\\George\\AppData\\Local\\Arduino15\\packages\\builtin\\tools\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\George\\AppData\\Local\\Temp\\arduino-sketch-EA59513BCA9A74522C9CC1275535FE56\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\\Users\\George\\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 -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\George\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.5\\cores\\arduino" "-IC:\\Users\\George\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.5\\variants\\standard" "-IC:\\Users\\George\\Documents\\Arduino\\libraries\\SchedTask\\src" "C:\\Users\\George\\AppData\\Local\\Temp\\arduino-sketch-EA59513BCA9A74522C9CC1275535FE56\\sketch\\LEDtest001.ino.cpp" -o "C:\\Users\\George\\AppData\\Local\\Temp\\arduino-sketch-EA59513BCA9A74522C9CC1275535FE56\\sketch\\LEDtest001.ino.cpp.o"
Compiling libraries...
Compiling library "SchedTask"
Using previously compiled file: C:\Users\George\AppData\Local\Temp\arduino-sketch-EA59513BCA9A74522C9CC1275535FE56\libraries\SchedTask\SchedBase.cpp.o
Using previously compiled file: C:\Users\George\AppData\Local\Temp\arduino-sketch-EA59513BCA9A74522C9CC1275535FE56\libraries\SchedTask\SchedTask.cpp.o
Compiling core...
Using precompiled core: C:\Users\George\AppData\Local\Temp\arduino-core-cache\core_arduino_avr_uno_769db067de1a9d9a2721f78fbda9f78e.a
Linking everything together...
"C:\\Users\\George\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\George\\AppData\\Local\\Temp\\arduino-sketch-EA59513BCA9A74522C9CC1275535FE56/LEDtest001.ino.elf" "C:\\Users\\George\\AppData\\Local\\Temp\\arduino-sketch-EA59513BCA9A74522C9CC1275535FE56\\sketch\\LEDtest001.ino.cpp.o" "C:\\Users\\George\\AppData\\Local\\Temp\\arduino-sketch-EA59513BCA9A74522C9CC1275535FE56\\libraries\\SchedTask\\SchedBase.cpp.o" "C:\\Users\\George\\AppData\\Local\\Temp\\arduino-sketch-EA59513BCA9A74522C9CC1275535FE56\\libraries\\SchedTask\\SchedTask.cpp.o" "C:\\Users\\George\\AppData\\Local\\Temp\\arduino-sketch-EA59513BCA9A74522C9CC1275535FE56/..\\arduino-core-cache\\core_arduino_avr_uno_769db067de1a9d9a2721f78fbda9f78e.a" "-LC:\\Users\\George\\AppData\\Local\\Temp\\arduino-sketch-EA59513BCA9A74522C9CC1275535FE56" -lm
C:\Users\George\AppData\Local\Temp\ccvISBn7.ltrans0.ltrans.o: In function `TurnOnLed()':
C:\Users\George\Documents\Arduino\Animations\LEDtest001/LEDtest001.ino:23: undefined reference to `digitalWrite'
C:\Users\George\AppData\Local\Temp\ccvISBn7.ltrans0.ltrans.o: In function `TurnOffLed()':
C:\Users\George\Documents\Arduino\Animations\LEDtest001/LEDtest001.ino:27: undefined reference to `digitalWrite'
C:\Users\George\AppData\Local\Temp\ccvISBn7.ltrans0.ltrans.o: In function `setup':
C:\Users\George\Documents\Arduino\Animations\LEDtest001/LEDtest001.ino:14: undefined reference to `pinMode'
C:\Users\George\Documents\Arduino\Animations\LEDtest001/LEDtest001.ino:15: undefined reference to `pinMode'
collect2.exe: error: ld returned 1 exit status

Using library SchedTask at version 1.1.4 in folder: C:\Users\George\Documents\Arduino\libraries\SchedTask 
Compilation error: exit status 1

This type of error typically indicates a corrupted compilation cache (which would not be expected to be fixed by going back to using 2.0.0-rc6 anyway):

Arduino IDE 1.x cleared the cache on exit, meaning it used to be possible to recover from this situation simply by restarting the IDE.

Arduino IDE 2.x does not do that. The good news is this speeds up compilation significantly since you only need to compile the core the first time for a given board, up until it is changed (e.g., you update to a new version of that board's platform. The bad news is that it makes the recovery from a corrupted cache slightly more complex.

I'll provide instructions.

  1. If it is running, select File > Quit from the Arduino IDE windows.
  2. Delete this file:
    C:\Users\George\AppData\Local\Temp\arduino-core-cache\core_arduino_avr_uno_769db067de1a9d9a2721f78fbda9f78e.a
    
    If looking for it with your file browser or command line, note that the C:\Users\George\AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
    :warning: Please be very careful when deleting things from your computer. When in doubt, back up!
  3. Start the Arduino IDE.

Now try compiling the sketch again. Hopefully the error will no longer occur.

That fixed the problem!! Thank you so much for the timely and accurate support.

George

You are welcome. I'm glad it is fixed now. Enjoy!

Per

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.