Arduino error code, help needed

So i am using this beginner book for arduino, but when i verify my code it gives me this error, any ideas?

Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: “Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)”

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware -hardware C:\Users\nickv\OneDrive\Documenten\ArduinoData\packages -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\tools-builder -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -tools C:\Users\nickv\OneDrive\Documenten\ArduinoData\packages -built-in-libraries C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\libraries -libraries C:\Users\nickv\OneDrive\Documenten\Arduino\libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -vid-pid=2341_0042 -ide-version=10813 -build-path C:\Users\nickv\AppData\Local\Temp\arduino_build_505965 -warnings=none -build-cache C:\Users\nickv\AppData\Local\Temp\arduino_cache_240246 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Users\nickv\OneDrive\Documenten\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\nickv\OneDrive\Documenten\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.arduinoOTA.path=C:\Users\nickv\OneDrive\Documenten\ArduinoData\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\nickv\OneDrive\Documenten\ArduinoData\packages\arduino\tools\arduinoOTA\1.3.0 -verbose C:\Users\nickv\OneDrive\Documenten\Arduino\sketch_feb14b\sketch_feb14b.ino

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\arduino-builder -compile -logger=machine -hardware C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware -hardware C:\Users\nickv\OneDrive\Documenten\ArduinoData\packages -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\tools-builder -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -tools C:\Users\nickv\OneDrive\Documenten\ArduinoData\packages -built-in-libraries C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\libraries -libraries C:\Users\nickv\OneDrive\Documenten\Arduino\libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -vid-pid=2341_0042 -ide-version=10813 -build-path C:\Users\nickv\AppData\Local\Temp\arduino_build_505965 -warnings=none -build-cache C:\Users\nickv\AppData\Local\Temp\arduino_cache_240246 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Users\nickv\OneDrive\Documenten\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\nickv\OneDrive\Documenten\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.arduinoOTA.path=C:\Users\nickv\OneDrive\Documenten\ArduinoData\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\nickv\OneDrive\Documenten\ArduinoData\packages\arduino\tools\arduinoOTA\1.3.0 -verbose C:\Users\nickv\OneDrive\Documenten\Arduino\sketch_feb14b\sketch_feb14b.ino

Using board ‘mega’ from platform in folder: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\arduino\avr

Using core ‘arduino’ from platform in folder: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\arduino\avr

Detecting libraries used…

“C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr/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=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR “-IC:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino” “-IC:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\variants\mega” “C:\Users\nickv\AppData\Local\Temp\arduino_build_505965\sketch\sketch_feb14b.ino.cpp” -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Generating function prototypes…

“C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr/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=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR “-IC:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino” “-IC:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\variants\mega” “C:\Users\nickv\AppData\Local\Temp\arduino_build_505965\sketch\sketch_feb14b.ino.cpp” -o “C:\Users\nickv\AppData\Local\Temp\arduino_build_505965\preproc\ctags_target_for_gcc_minus_e.cpp” -DARDUINO_LIB_DISCOVERY_PHASE

“C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\tools-builder\ctags\5.8-arduino11/ctags” -u --language-force=c++ -f - --c+±kinds=svpf --fields=KSTtzns --line-directives “C:\Users\nickv\AppData\Local\Temp\arduino_build_505965\preproc\ctags_target_for_gcc_minus_e.cpp”

Compiling sketch…

“C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr/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=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR “-IC:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino” “-IC:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\variants\mega” “C:\Users\nickv\AppData\Local\Temp\arduino_build_505965\sketch\sketch_feb14b.ino.cpp” -o “C:\Users\nickv\AppData\Local\Temp\arduino_build_505965\sketch\sketch_feb14b.ino.cpp.o”

Compiling libraries…

Compiling core…

Using precompiled core: C:\Users\nickv\AppData\Local\Temp\arduino_cache_240246\core\core_arduino_avr_mega_cpu_atmega2560_d72cf7820821928d7aba3a85f82dacbf.a

Linking everything together…

“C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr/bin/avr-gcc” -w -Os -g -flto -fuse-linker-plugin -Wl,–gc-sections -mmcu=atmega2560 -o “C:\Users\nickv\AppData\Local\Temp\arduino_build_505965/sketch_feb14b.ino.elf” “C:\Users\nickv\AppData\Local\Temp\arduino_build_505965\sketch\sketch_feb14b.ino.cpp.o” “C:\Users\nickv\AppData\Local\Temp\arduino_build_505965/…\arduino_cache_240246\core\core_arduino_avr_mega_cpu_atmega2560_d72cf7820821928d7aba3a85f82dacbf.a” “-LC:\Users\nickv\AppData\Local\Temp\arduino_build_505965” -lm

C:\Users\nickv\AppData\Local\Temp\ccsjHI6y.ltrans0.ltrans.o: In function `main’:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/main.cpp:46: undefined reference to `loop’

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board Arduino Mega or Mega 2560.

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/main.cpp:46: undefined reference to `loop'

Your code lacks the loop() function. All Arduino code needs a setup() and loop() function.

undefined reference to `loop'

looks like you have not got a void loop().

Pleae post your code (in tags). and we can explain better.

david_2018:
Your code lacks the loop() function. All Arduino code needs a setup() and loop() function.

david_2018:
Your code lacks the loop() function. All Arduino code needs a setup() and loop() function.

I see, i will check the code tomorrow, since it is very late right now, thank you

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