Confused on how to use #include

I have got a library on the forum to do RTC.
There are 2 files:
DS1307.h

/* 
   DS1307.h - library for DS1307 rtc 
   Created by matt.joyce@gmail.com, December, 2007. 
   Released into the public domain. 
*/ 
  
// ensure this library description is only included once 
#ifndef DS1307_h 
#define DS1307_h 
  
// include types & constants of Wiring core API 
#include <WConstants.h> 
  
// include types & constants of Wire ic2 lib 
#include <Wire.h>
... ... (just definition)

DS1307.cpp:

/* 
   DS1307.cpp - library for DS1307 rtc 
   Created by matt.joyce@gmail.com, December, 2007. 
   Released into the public domain. 
 */ 
  
#include "DS1307.h" 
#include <WProgram.h>  
#include <Wire.h>
... ... (this .cpp uses wire functions)

My main code:

#include <DS1307.h>
#include <LiquidCrystal.h>
... ...(more code)

When I tried to compile, I get error

C:\Program Files\arduino-0018\libraries\DS1307\/DS1307.h:15:19: error: Wire.h: No such file or directory

                 from C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp:8:

c:/program files/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected unqualified-id before 'int'

c:/program files/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected `)' before 'int'

c:/program files/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected `)' before 'int'

                 from C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp:8:

c:/program files/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected unqualified-id before 'double'

c:/program files/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'

c:/program files/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'

C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp: In constructor 'DS1307::DS1307()':

C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp:12: error: 'Wire' was not declared in this scope

C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp: In member function 'void DS1307::read_rtc()':

C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp:25: error: 'Wire' was not declared in this scope

C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp: In member function 'void DS1307::save_rtc()':

C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp:41: error: 'Wire' was not declared in this scope

C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp: In member function 'void DS1307::get_sram_data(byte*)':

C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp:172: error: 'Wire' was not declared in this scope

C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp: In member function 'void DS1307::set_sram_data(byte*)':

C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp:186: error: 'Wire' was not declared in this scope

C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp: In member function 'byte DS1307::get_sram_byte(int)':

C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp:199: error: 'Wire' was not declared in this scope

C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp: In member function 'void DS1307::set_sram_byte(byte, int)':

C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp:209: error: 'Wire' was not declared in this scope

Any help is appreciated. I've never had an include problem but this wire.h thing is driving me nuts. Thanks.

Try adding Wire.h to the sketch, too.

Try:
#include <Wire.h>
before:
#include <DS1307.h>

Which version of the IDE are you uing?

Gordon

Added the wire.h file and swapped the include commands. No go.
I then added #include "wire.h" in my main sketch and no go.

If you want to refer to a .h file in your libraries, you use <Wire.h>, right?

If you want to refer to a .h file elsewhere, you use "../Wire/Wire.h", right?

The ../Wire/Wire.h construct would look for a file called Wire.h in a directory called Wire in the parent directory of the current directory. It probably is not what you want to use.

There are two formats for the include statement:
#include <Wire.h>
#include "Wire.h"

The "" version uses explicit paths, relative to the sketch directory. The <> uses both explicit and implicit paths. The implicit paths include the Arduino directories and the AVR directories.

In the IDE, can you import the Wire library, using Sketch + Import Library?

I think the compiler is telling you the Wire library is not in your libraries folder.

C:\Program Files\arduino-0018\libraries\DS1307\/DS1307.h:15:19: error: Wire.h: No such file or directory

                 from C:\Program Files\arduino-0018\libraries\DS1307\DS1307.cpp:8: