Error compiling for board Arduino Pro or Pro Mini.

Can someone please help me with this code , I'm new to Arduino , trying to program Pro Mini to send an audio Output when object detected by any of the three ultrasonic sensors. Please help me to update thi code.

#define trigPin3 8 // These lines assign names to values
#define echoPin3 7 // so they can be easily identified.
#define trigPin2 6 // These lines assign names to values
#define echoPin2 5 // so they can be easily identified.
#define trigPin1 4 // These lines assign names to values
#define echoPin1 3 // so they can be easily identified.
#define buzzer 12 // These are set before the code
#include "SD.h"
#define SD_ChipSelectPin 10
#include "TMRpcm.h"
#include "SPI.h"

TMRpcm tmrpcm;

/* This section of code below runs only one time.
It enables the serial monitor to see output and
sets the pins to input or output.
*/
void setup() {
tmrpcm.speakerPin = 9;
Serial.begin(9600);
if (!SD.begin(SD_ChipSelectPin))
{
Serial.println("SD fail");
return;
}
Serial.begin (9600);
pinMode(trigPin1, OUTPUT);
pinMode(trigPin2, OUTPUT);
pinMode(trigPin3, OUTPUT);
pinMode(echoPin1, INPUT);
pinMode(echoPin2, INPUT);
pinMode(echoPin3, INPUT);
pinMode(buzzer, OUTPUT);
}

/* The remaining part of the code runs in a constant loop.
It triggers the ultrasonic sensor and calculates the
time it took for the sound waves to return. It converts
the time in milliseconds into distance in centimeters.
*/
void sonar1() {
long duration, distance;
digitalWrite(trigPin1, LOW);
delayMicroseconds(2);
digitalWrite(trigPin1, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin1, LOW);
duration = pulseIn(echoPin1, HIGH);
distance = (duration / 2) / 29.1;
Serial.print(distance);
Serial.println(" cm");

// This part of the code below determines whether to
// beep depending on the distance detected. If the object
// is within 62 start the beeps.

if (distance > 30 and distance < 100) {
tmrpcm.setVolume(6);
tmrpcm.play("test.wav");

}
if (distance > 0 and distance < 31) {
tmrpcm.setVolume(6);
tmrpcm.play("test.wav");

}
else {
}
delay (500);

}
void sonar2() {
long duration, distance;
digitalWrite(trigPin2, LOW);
delayMicroseconds(2);
digitalWrite(trigPin2, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin2, LOW);
duration = pulseIn(echoPin2, HIGH);
distance = (duration / 2) / 29.1;
Serial.print(distance);
Serial.println(" cm");

// This part of the code below determines whether to
// beep depending on the distance detected. If the object
// is within 62 start the beeps.

if (distance > 30 and distance < 100) {
tmrpcm.setVolume(6);
tmrpcm.play("test.wav");

}
if (distance > 0 and distance < 31) {
tmrpcm.setVolume(6);
tmrpcm.play("test.wav");

}
else {
}
delay (500);

}
void Sonar3() {
long duration, distance;
digitalWrite(trigPin3, LOW);
delayMicroseconds(2);
digitalWrite(trigPin3, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin3, LOW);
duration = pulseIn(echoPin3, HIGH);
distance = (duration / 2) / 29.1;
Serial.print(distance);
Serial.println(" cm");

// This part of the code below determines whether to
// beep depending on the distance detected. If the object
// is within 62 start the beeps.

if (distance > 30 and distance < 100) {
tmrpcm.setVolume(6);
tmrpcm.play("test.wav");

}
if (distance > 0 and distance < 31) {
tmrpcm.setVolume(6);
tmrpcm.play("test.wav");

}
else {
}
delay (500);

}

Why is there no loop() function in your program ?

Sir i have added the loops , this are the three loops i want to run for 3 different sensors , but now getting redifination of void loop error ......due to use of multiple loops .... please help me to solve this

#define trigPin3 8 // These lines assign names to values
#define echoPin3 7 // so they can be easily identified.
#define trigPin2 6 // These lines assign names to values
#define echoPin2 5 // so they can be easily identified.
#define trigPin1 4 // These lines assign names to values
#define echoPin1 3 // so they can be easily identified.
#define buzzer 12 // These are set before the code
#include "SD.h"
#define SD_ChipSelectPin 10
#include "TMRpcm.h"
#include "SPI.h"

TMRpcm tmrpcm;

/* This section of code below runs only one time.
It enables the serial monitor to see output and
sets the pins to input or output.
*/
void setup() {
tmrpcm.speakerPin = 9;
Serial.begin(9600);
if (!SD.begin(SD_ChipSelectPin))
{
Serial.println("SD fail");
return;
}
Serial.begin (9600);
pinMode(trigPin1, OUTPUT);
pinMode(trigPin2, OUTPUT);
pinMode(trigPin3, OUTPUT);
pinMode(echoPin1, INPUT);
pinMode(echoPin2, INPUT);
pinMode(echoPin3, INPUT);
pinMode(buzzer, OUTPUT);
}

/* The remaining part of the code runs in a constant loop.
It triggers the ultrasonic sensor and calculates the
time it took for the sound waves to return. It converts
the time in milliseconds into distance in centimeters.
*/
void loop() {
long duration, distance;
digitalWrite(trigPin1, LOW);
delayMicroseconds(2);
digitalWrite(trigPin1, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin1, LOW);
duration = pulseIn(echoPin1, HIGH);
distance = (duration / 2) / 29.1;
Serial.print(distance);
Serial.println(" cm");

// This part of the code below determines whether to
// beep depending on the distance detected. If the object
// is within 62 start the beeps.

if (distance > 30 and distance < 100) {
tmrpcm.setVolume(6);
tmrpcm.play("test.wav");

}
if (distance > 0 and distance < 31) {
tmrpcm.setVolume(6);
tmrpcm.play("test.wav");

}
else {
} delay (500);

}

void loop() {
long duration, distance;
digitalWrite(trigPin2, LOW);
delayMicroseconds(2);
digitalWrite(trigPin2, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin2, LOW);
duration = pulseIn(echoPin2, HIGH);
distance = (duration / 2) / 29.1;
Serial.print(distance);
Serial.println(" cm");

// This part of the code below determines whether to
// beep depending on the distance detected. If the object
// is within 62 start the beeps.

if (distance > 30 and distance < 100) {
tmrpcm.setVolume(6);
tmrpcm.play("test.wav");

}
if (distance > 0 and distance < 31) {
tmrpcm.setVolume(6);
tmrpcm.play("test.wav");

}
else {
}
delay (500);

}
void loop() {
long duration, distance;
digitalWrite(trigPin3, LOW);
delayMicroseconds(2);
digitalWrite(trigPin3, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin3, LOW);
duration = pulseIn(echoPin3, HIGH);
distance = (duration / 2) / 29.1;
Serial.print(distance);
Serial.println(" cm");

// This part of the code below determines whether to
// beep depending on the distance detected. If the object
// is within 62 start the beeps.

if (distance > 30 and distance < 100) {
tmrpcm.setVolume(6);
tmrpcm.play("test.wav");

}
if (distance > 0 and distance < 31) {
tmrpcm.setVolume(6);
tmrpcm.play("test.wav");

}
else {
}
delay (500);

}

As you can't have discovered you can't have multiple functions with the same name in a program. After all, how would it know which one to run ?

If you have 3 functions named sonar1(), sonar2() and sonar3() and you want to run them one after the other then call them from the single loop() function like this

void loop()
  {
    sonar1();
    sonar2();
    sonar3();
  }