"In function 'main' " error while compiling the code

Hello I am running an arduino uno on Mac 10.10. in the final stages of compilation of my code it give me this error.
This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.
Arduino: 1.0.6 (Mac OS X), Board: “Arduino Uno”
core.a(main.cpp.o): In function main': /Users/Jacob/Desktop/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/main.cpp:43: undefined reference to loop’

Here is the code that I am trying to run. It is for a simple alarm that will play a sound. Right now it is set to the main theme from the news room.

#include <TimeAlarms.h>

#include <Time.h>

  int speakerPin = 9;
  int length = 35; // the number of notes
  char notes[] = "cdfefgecabddcbCggcdfefggcfeddcfedd "; // a space represents a rest
  int beats[] = { 2, 4, 1, 1, 2, 2, 7, 1, 1, 1, 2, 7, 1, 1, 1, 2, 6, 2, 4, 1, 1, 2, 2, 7, 1, 1, 1, 2, 7, 1, 1, 1, 2, 8,  1, };
  int tempo = 200;
  
void setup(){
  void sync(time_t time);
  Alarm.alarmRepeat(10,00,00, MorningAlarm);
  pinMode(speakerPin, OUTPUT);
}

 void playTone(int tone, int duration) {
    for (long i = 0; i < duration * 1000L; i += tone * 2) {
      digitalWrite(speakerPin, HIGH);
      delayMicroseconds(tone);
      digitalWrite(speakerPin, LOW);
      delayMicroseconds(tone);
    }
  }
  
  void playNote(char note, int duration) {
    char names[] = { 'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C' };
    int tones[] = { 1915, 1700, 1519, 1432, 1275, 1136, 1014, 956 };
    
  // play the tone corresponding to the note name
    for (int i = 0; i < 8; i++) {
      if (names[i] == note) {
        playTone(tones[i], duration);
      }
    }
  }

void MorningAlarm(){
  


    for (int i = 0; i < length; i++) {
      if (notes[i] == ' ') {
        delay(beats[i] * tempo); // rest
      } else {
        playNote(notes[i], beats[i] * tempo);
      }
    
    // pause between notes
      delay(tempo / 2);
  }
}

There is probably a very simple solution to this that I can not find or figure out, so any help would be great because I am still fairly new to this. Thank you for your help.

You have to have a function named void loop() defined somewhere in your code even if it is empty.

Behind the scenes, Arduino is actually compiling this code:

int main(void)
{
    init();

    initVariant();

#if defined(USBCON)
    USBDevice.attach();
#endif

    setup();
    
    for (;;) {
        loop();
        if (serialEventRun) serialEventRun();
    }
        
    return 0;
}

In the .ino file that you create, you are providing the setup() and loop() functions for this code. From those functions you can call whatever other code you want to call. The setup function will run once and the loop function will run over and over again forever.

In the code as you have it written, only the three lines in setup would be run. You have a bunch of other functions defined, but you're not calling any of them anywhere. So you should probably have some code in loop that is going to call those functions.