Problems with Dallas temperature sensor code
I presume the exact error you get is


  error: 'OneWire' does not name a type


This error is typical when the OneWire library (or any other library for that matter) is not located under the  libraries folder, which should be at the root of the Arduino installation folder.

Also, make sure that the OneWire.h and OneWire.cpp files are 1 folder down the hierarchy, as follows:

[Arduino Installation Folder]\libraries\OneWire\OneWire.h

If they are nested deeper inside the folder hierarchy, the Arduino IDE will not find these files in its initial scan, and you will get the same error.

Make sure to close all Arduino IDE windows and re-open it after fixing the folder path.