RTC module error

Hi guys, trying to get this RYC module working but keep getting error even tho I added wire library:
Error compiling for board Arduino/Genuino Uno.

// This code tests the DS1307 Real Time clock on the Arduino board.
// The ds1307 works in binary coded decimal or BCD.  You can look up
// bcd in google if you aren't familior with it.  There can output
// a square wave, but I don't expose that in this code.  See the
// ds1307 for it's full capabilities.

#include "Wire.h"
#define DS1307_I2C_ADDRESS 0x68

// Convert normal decimal numbers to binary coded decimal
byte decToBcd(byte val)
{
  return ( (val/10*16) + (val%10) );
}

// Convert binary coded decimal to normal decimal numbers
byte bcdToDec(byte val)
{
  return ( (val/16*10) + (val%16) );
}

// Stops the DS1307, but it has the side effect of setting seconds to 0
// Probably only want to use this for testing
/*void stopDs1307()
{
  Wire.beginTransmission(DS1307_I2C_ADDRESS);
  Wire.send(0);
  Wire.send(0x80);
  Wire.endTransmission();
}*/

// 1) Sets the date and time on the ds1307
// 2) Starts the clock
// 3) Sets hour mode to 24 hour clock
// Assumes you're passing in valid numbers
void setDateDs1307(byte second,        // 0-59
                   byte minute,        // 0-59
                   byte hour,          // 1-23
                   byte dayOfWeek,     // 1-7
                   byte dayOfMonth,    // 1-28/29/30/31
                   byte month,         // 1-12
                   byte year)          // 0-99
{
   Wire.beginTransmission(DS1307_I2C_ADDRESS);
   Wire.write(0);
   Wire.write(decToBcd(second));    // 0 to bit 7 starts the clock
   Wire.write(decToBcd(minute));
   Wire.write(decToBcd(hour));      // If you want 12 hour am/pm you need to set
                                   // bit 6 (also need to change readDateDs1307)
   Wire.write(decToBcd(dayOfWeek));
   Wire.write(decToBcd(dayOfMonth));
   Wire.write(decToBcd(month));
   Wire.write(decToBcd(year));
   Wire.endTransmission();
}

// Gets the date and time from the ds1307
void getDateDs1307(byte *second,
          byte *minute,
          byte *hour,
          byte *dayOfWeek,
          byte *dayOfMonth,
          byte *month,
          byte *year)
{
  // Reset the register pointer
  Wire.beginTransmission(DS1307_I2C_ADDRESS);
  Wire.write(0);
  Wire.endTransmission();
  
  Wire.requestFrom(DS1307_I2C_ADDRESS, 7);

  // A few of these need masks because certain bits are control bits
  *second     = bcdToDec(Wire.read() & 0x7f);
  *minute     = bcdToDec(Wire.read());
  *hour       = bcdToDec(Wire.read() & 0x3f);  // Need to change this if 12 hour am/pm
  *dayOfWeek  = bcdToDec(Wire.read());
  *dayOfMonth = bcdToDec(Wire.read());
  *month      = bcdToDec(Wire.read());
  *year       = bcdToDec(Wire.read());
}


void setup()
{
  byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
  Wire.begin();
  Serial.begin(9600);
  
  // Change these values to what you want to set your clock to.
  // You probably only want to set your clock once and then remove
  // the setDateDs1307 call.
  second = 45;
  minute = 3;
  hour = 7;
  dayOfWeek = 5;
  dayOfMonth = 17;
  month = 4;
  year = 8;
  setDateDs1307(second, minute, hour, dayOfWeek, dayOfMonth, month, year);
}

void loop()
{
  byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;

  getDateDs1307(&second, &minute, &hour, &dayOfWeek, &dayOfMonth, &month, &year);
  Serial.print(hour, DEC);
  Serial.print(":");
  Serial.print(minute, DEC);
  Serial.print(":");
  Serial.print(second, DEC);
  Serial.print("  ");
  Serial.print(month, DEC);
  Serial.print("/");
  Serial.print(dayOfMonth, DEC);
  Serial.print("/");
  Serial.print(year, DEC);
  Serial.print("  Day_of_week:");
  Serial.println(dayOfWeek, DEC);

  delay(1000);

Post the error message.

Arduino: 1.6.8 (Mac OS X), Board: "Arduino/Genuino Uno"

sketch/sketch_apr02c.ino.cpp.o: In function setDateDs1307(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)': /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:50: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:50: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:50: undefined reference to TwoWire::beginTransmission(int)'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:51: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:51: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:52: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:52: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:52: undefined reference to TwoWire::write(unsigned char)' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:53: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:53: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:53: undefined reference to TwoWire::write(unsigned char)'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:54: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:54: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:54: undefined reference to TwoWire::write(unsigned char)' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:56: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:56: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:56: undefined reference to TwoWire::write(unsigned char)'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:57: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:57: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:57: undefined reference to TwoWire::write(unsigned char)' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:58: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:58: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:58: undefined reference to TwoWire::write(unsigned char)'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:59: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:59: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:59: undefined reference to TwoWire::write(unsigned char)' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:60: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:60: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:60: undefined reference to TwoWire::endTransmission()'
sketch/sketch_apr02c.ino.cpp.o: In function setup': /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:93: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:93: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:93: undefined reference to TwoWire::begin()'
sketch/sketch_apr02c.ino.cpp.o: In function getDateDs1307(unsigned char*, unsigned char*, unsigned char*, unsigned char*, unsigned char*, unsigned char*, unsigned char*)': /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:73: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:73: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:73: undefined reference to TwoWire::beginTransmission(int)'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:74: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:74: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:75: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:75: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:75: undefined reference to TwoWire::endTransmission()' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:77: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:77: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:77: undefined reference to TwoWire::requestFrom(int, int)'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:80: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:80: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:80: undefined reference to TwoWire::read()' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:81: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:81: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:81: undefined reference to TwoWire::read()'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:82: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:82: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:82: undefined reference to TwoWire::read()' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:83: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:83: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:83: undefined reference to TwoWire::read()'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:84: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:84: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:84: undefined reference to TwoWire::read()' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:85: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:85: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:85: undefined reference to TwoWire::read()'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:86: undefined reference to Wire' /Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:86: undefined reference to Wire'
/Users/admin/Documents/Arduino/sketch_apr02c/sketch_apr02c.ino:86: undefined reference to `TwoWire::read()'
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

You appear to be using a junk version of the same method that I use. This has two separate programmes, one to set the clock, the other to use it. but you have them combined. You will get a better explanation here
http://bildr.org/2011/03/ds1307-arduino/
Note that is also works fine with the DS3231, which is a better module.

Try including <Wire.h> instead of “Wire.h”. It doesn’t make any difference on Windows but perhaps Mac is picky. If that doesn’t fix it, you haven’t installed the Arduino IDE correctly on your Mac.
You’ll also need to add the missing close brace at the end of your code.

Pete