Compile error

Hi, My name is Leo and I am new to this forum and new to arduino too.

I get a compile error when trying to upload the attached file to an Arduino Mega. Below you see the error message

Hope somebody can help me out.

Thank you in advance.

Error message:

Arduino: 1.8.4 (Windows 10), Board:“Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\FLiGH HiGH\Documents\Arduino\libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -vid-pid=0X2341_0X0042 -ide-version=10804 -build-path C:\Users\FLIGHH~1\AppData\Local\Temp\arduino_build_252979 -warnings=all -build-cache C:\Users\FLIGHH~1\AppData\Local\Temp\arduino_cache_599458 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\FLiGH HiGH\Documents\Arduino737-master\Arduino737\Arduino737.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\FLiGH HiGH\Documents\Arduino\libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -vid-pid=0X2341_0X0042 -ide-version=10804 -build-path C:\Users\FLIGHH~1\AppData\Local\Temp\arduino_build_252979 -warnings=all -build-cache C:\Users\FLIGHH~1\AppData\Local\Temp\arduino_cache_599458 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\FLiGH HiGH\Documents\Arduino737-master\Arduino737\Arduino737.ino
Using board ‘mega’ from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core ‘arduino’ from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr

WAARSCHUWING: Categorie ‘’ in bibliotheek EEPROM is niet geldig. Wordt gewijzigd naar ‘Uncategorized’
Build-opties gewijzigd, alles wordt opnieuw gebuild

Detecting libraries used…
“C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10804 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino” “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega” “C:\Users\FLIGHH~1\AppData\Local\Temp\arduino_build_252979\sketch\Arduino737.ino.cpp” -o “nul”
“C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10804 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino” “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega” “-IC:\Users\FLiGH HiGH\Documents\Arduino\libraries\LedControl-1.0.6\src” “C:\Users\FLIGHH~1\AppData\Local\Temp\arduino_build_252979\sketch\Arduino737.ino.cpp” -o “nul”
“C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10804 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino” “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega” “-IC:\Users\FLiGH HiGH\Documents\Arduino\libraries\LedControl-1.0.6\src” “C:\Users\FLIGHH~1\AppData\Local\Temp\arduino_build_252979\sketch\Arduino737.ino.cpp” -o “C:\Users\FLIGHH~1\AppData\Local\Temp\arduino_build_252979\preproc\ctags_target_for_gcc_minus_e.cpp”

C:\Users\FLiGH HiGH\Documents\Arduino737-master\Arduino737\Arduino737.ino:3:24: fatal error: LedControl.h: No such file or directory

#include <LedControl.h>

^

compilation terminated.

Bibliotheek LedControl-1.0.6 op versie 1.0.6 in map: C:\Users\FLiGH HiGH\Documents\Arduino\libraries\LedControl-1.0.6 wordt gebruikt
exit status 1
Fout bij het compileren voor board Arduino/Genuino Mega or Mega 2560

Arduino737.ino (18.9 KB)

C:\Users\FLiGH HiGH\Documents\Arduino737-master\Arduino737\Arduino737.ino:3:24: fatal error: LedControl.h: No such file or directory

It doesn't get much clearer than that. Have you installed that library? How and where?

Thank you for replying. The library is installed in C:\Users\FLiGH HiGH\Documents\Arduino\libraries

The installation of the library went via the menu: add .zip library

OK, when you look at that folder what's in it? What filenames? The folder doesn't have "Master" added to the end of the name does it?

There are all folders in this folder:

EEPROM
Encoder-1.4.1
Ethernet-1.1.2
LedControl
readme.txt

There is no ""Master"" added to the folder

What’s inside LedControl is what I was getting at.

Inside LedControl:

Folder - examples
Folder - src

kewords.txt
library.properties
LICENSE

What's inside src?

We're looking for LedControl.h and LedControl.cpp in case you find it somewhere else.

Both files LedControl.cpp and LedControl.h are in the src folder

cut them from that folder and paste them one level up in that LedControl folder. See if it compiles now.

Voel:
There are all folders in this folder:
...
LedControl

The IDE output you posted contradicts you:

Voel:
Bibliotheek LedControl-1.0.6 op versie 1.0.6 in map: C:\Users\FLiGH HiGH\Documents\Arduino\libraries\LedControl-1.0.6 wordt gebruikt

That translates to

Using library LedControl-1.0.6 at version 1.0.6 in folder: C:\Users\FLiGH  HiGH\Documents\Arduino\libraries\LedControl-1.0.6

This is strange that it says the library was used but also that it can't find LedControl.h.

I have fixed it! Thank you very much for your help. I have copied the library files to:

C:\Program Files (x86)\Arduino
Deleted the files in folder C:\Users\FLiGH HiGH\Documents\Arduino\libraries

That did the job.

Thanks for your help

It's a bad idea to install libraries to C:\Program Files (x86)\Arduino because they will all be lost whenever you update to a different version of the Arduino IDE, then you'll be trying to figure out why none of your projects will compile with the new IDE version.

Oke, that is not good indeed, but what is the best place to put the files in?

Always install libraries to the libraries subfolder of your sketchbook folder. You can find/set the location of the sketchbook folder in the Arduino IDE at File > Preferences > Sketchbook location.

checked the sketchbook location and installed all the libraries in there and I ended up with the same problem as where I started this topic with. Also copied the files LedControl.h and LedControl.cpp one level up. But this is not working.....

Try this:

  • Sketch > Include Library > Manage Libraries
  • Wait for download to finish
  • In the "Filter your search..." box, type "ledcontrol"
  • Click on the LedControl entry
  • Click "Install"
  • Wait for installation to finish
  • Click "Close"
  • Try compiling your sketch again.

I have followed your instructions. Installed a new version of LedControl. Problems are same as when I started this topic.

I'm stumped. It's the first time I've seen something like this in years. You could try changing your sketchbook location to a location outside of C:\Users\FLiGH HiGH\Documents via the File > Preferences > Sketchbook location. I never trust these special Windows folders.

Other than that you could go back to using the libraries folder of the Arduino IDE installation folder but just keep in mind that you will need to either copy all of your own libraries out of there before updating or install them all over again every time. It's not such a big deal as long as you know it's going to happen and be very careful not to lose your only copy of any custom libraries you have written/modified.

Thank you all for putting me in the right direction. I pointed wrong to the sketchfile, I adressed the directory without a slash (). Added the slash and the compiling error was gone!

:slight_smile: :slight_smile: :slight_smile: SOLVED