title: Reading a tiff file using libtiff in c++ : prevent warning printout
body: <p>Reading a tiff file using libtiff in c++ : prevent warning printout </p>
  
  <p>When reading a tiff file I get a warning message to the console every time an unknown tag is read by the function TIFFReadDirectory().  From an answer provided by the user Borovsky I understood that to prevent this, I need to :</p>
  
  <p>“Start by creating class which inherits from TiffErrorHandler and overloads WarningHandler and WarningHandlerEx methods. Basically, you could do nothing in these methods.
  Then set an instance of you class as the error handler for the library with SetErrorHandler method. The method is static and you can set error handler before opening an image. “
  The problem is that I am a beginner in C++ and although I understand how to implement the above, I do not seem to be able to find this TiffErrorHandler class.  My code looks as follows:</p>
  
  <pre><code>class myTiffErrorHandler : public TIFFErrorHandler {  &lt;- THE CLASS CANNOT BE FOUND
  
    public: 
        void WarningHandler() { }  
        void WarningHandlerEx() { } 
  
  };
  </code></pre>
  
  <p>Then all I do in my main() is:</p>
  
  <pre><code>Main() {
  
     tif = TIFFOpen(“fn.tif”, "r"));  
  
  int numOfFrames=0;
  
      do {
          numOfFrames++;
      } while (TIFFReadDirectory(tif));
  }
  </code></pre>
  
  <p>Can someone help me figure this out?  What am I doing wrong and where is this class being defined?</p>
  
  <p>Thanks</p>