Hello,

I have a strange problem. I am trying to use the tesseract library in my own project. First, I have used it in a new project, just to test it, and everything has gone fine. After that, I have integrated in a bigger project in the same way as I did in the first one, but I am getting these errors when compiling:

1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1011): error C2143: syntax error : missing ';' before '<'
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1011): error C2059: syntax error : '<'
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1011): error C2143: syntax error : missing ';' before '{'
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1011): error C2447: '{' : missing function header (old-style formal list?)

Here is the code of tesscallback.h:

///////////////////////////////////////////////////////////////////////
// File:        tesscallback.h
// Description: classes and functions to replace pointer-to-functions
// Author:      Samuel Charron
//
// (C) Copyright 2006, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
///////////////////////////////////////////////////////////////////////

#ifndef _TESS_CALLBACK_SPECIALIZATIONS_H
#define _TESS_CALLBACK_SPECIALIZATIONS_H

#include "host.h"  // For NULL.

struct TessCallbackUtils_ {
  static void FailIsRepeatable(const char* name);
};


class TessClosure {
 public:
  virtual ~TessClosure() { }
  virtual void Run() = 0;
};

template <class R>
class TessResultCallback {
 public:
  virtual ~TessResultCallback() { }
  virtual R Run() = 0;
};

template <bool del, class R, class T>
class _ConstTessMemberResultCallback_0_0 : public TessResultCallback<R> {
 public:
  typedef TessResultCallback<R> base;
  typedef R (T::*MemberSignature)() const;

 private:
  const T* object_;
  MemberSignature member_;

 public:
  inline _ConstTessMemberResultCallback_0_0(
     const T* object, MemberSignature member)
    : object_(object),
      member_(member) {
  }

  virtual R Run() {
    if (!del) {
      R result = (object_->*member_)();
      return result;
    } else {
      R result = (object_->*member_)();
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
      return result;
    }
  }
};

template <bool del, class T>
class _ConstTessMemberResultCallback_0_0<del, void, T>
  : public TessClosure {
 public:
  typedef TessClosure base;
  typedef void (T::*MemberSignature)() const;

 private:
  const T* object_;
  MemberSignature member_;

 public:
  inline _ConstTessMemberResultCallback_0_0(
      const T* object, MemberSignature member)
    : object_(object),
      member_(member) {
  }

  virtual void Run() {
    if (!del) {
      (object_->*member_)();
    } else {
      (object_->*member_)();
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
    }
  }
};

#ifndef SWIG
template <class T1, class T2, class R>
inline typename _ConstTessMemberResultCallback_0_0<true,R,T1>::base*
NewTessCallback(
    const T1* obj, R (T2::*member)() const) {
  return new _ConstTessMemberResultCallback_0_0<true,R,T1>(
      obj, member);
}
#endif

#ifndef SWIG
template <class T1, class T2, class R>
inline typename _ConstTessMemberResultCallback_0_0<false,R,T1>::base*
NewPermanentTessCallback(
    const T1* obj, R (T2::*member)() const) {
  return new _ConstTessMemberResultCallback_0_0<false,R,T1>(
      obj, member);
}
#endif

template <bool del, class R, class T>
class _TessMemberResultCallback_0_0 : public TessResultCallback<R> {
 public:
  typedef TessResultCallback<R> base;
  typedef R (T::*MemberSignature)() ;

 private:
  T* object_;
  MemberSignature member_;

 public:
  inline _TessMemberResultCallback_0_0(
      T* object, MemberSignature member)
    : object_(object),
      member_(member) {
  }

  virtual R Run() {
    if (!del) {
      R result = (object_->*member_)();
      return result;
    } else {
      R result = (object_->*member_)();
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
      return result;
    }
  }
};

template <bool del, class T>
class _TessMemberResultCallback_0_0<del, void, T>
  : public TessClosure {
 public:
  typedef TessClosure base;
  typedef void (T::*MemberSignature)() ;

 private:
  T* object_;
  MemberSignature member_;

 public:
  inline _TessMemberResultCallback_0_0(
       T* object, MemberSignature member)
    : object_(object),
      member_(member) {
  }

  virtual void Run() {
    if (!del) {
      (object_->*member_)();
    } else {
      (object_->*member_)();
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
    }
  }
};

#ifndef SWIG
template <class T1, class T2, class R>
inline typename _TessMemberResultCallback_0_0<true,R,T1>::base*
NewTessCallback(
     T1* obj, R (T2::*member)() ) {
  return new _TessMemberResultCallback_0_0<true,R,T1>(
      obj, member);
}
#endif

#ifndef SWIG
template <class T1, class T2, class R>
inline typename _TessMemberResultCallback_0_0<false,R,T1>::base*
NewPermanentTessCallback(
     T1* obj, R (T2::*member)() ) {
  return new _TessMemberResultCallback_0_0<false,R,T1>(
      obj, member);
}
#endif

template <bool del, class R>
class _TessFunctionResultCallback_0_0 : public TessResultCallback<R> {
 public:
  typedef TessResultCallback<R> base;
  typedef R (*FunctionSignature)();

 private:
  FunctionSignature function_;

 public:
  inline _TessFunctionResultCallback_0_0(
      FunctionSignature function)
    : function_(function) {
  }

  virtual R Run() {
    if (!del) {
      R result = (*function_)();
      return result;
    } else {
      R result = (*function_)();
      //  zero out the pointer to ensure segfault if used again
      function_ = NULL;
      delete this;
      return result;
    }
  }
};

template <bool del>
class _TessFunctionResultCallback_0_0<del, void>
  : public TessClosure {
 public:
  typedef TessClosure base;
  typedef void (*FunctionSignature)();

 private:
  FunctionSignature function_;

 public:
  inline _TessFunctionResultCallback_0_0(
      FunctionSignature function)
    : function_(function) {
  }

  virtual void Run() {
    if (!del) {
      (*function_)();
    } else {
      (*function_)();
      //  zero out the pointer to ensure segfault if used again
      function_ = NULL;
      delete this;
    }
  }
};

template <class R>
inline typename _TessFunctionResultCallback_0_0<true,R>::base*
NewTessCallback(R (*function)()) {
  return new _TessFunctionResultCallback_0_0<true,R>(function);
}

template <class R>
inline typename _TessFunctionResultCallback_0_0<false,R>::base*
NewPermanentTessCallback(R (*function)()) {
  return new _TessFunctionResultCallback_0_0<false,R>(function);
}

template <class A1>
class TessCallback1 {
 public:
  virtual ~TessCallback1() { }
  virtual void Run(A1) = 0;
};

template <class R, class A1>
class TessResultCallback1 {
 public:
  virtual ~TessResultCallback1() { }
  virtual R Run(A1) = 0;
};

template <bool del, class R, class T, class A1>
class _ConstTessMemberResultCallback_0_1 : public TessResultCallback1<R,A1> {
 public:
  typedef TessResultCallback1<R,A1> base;
  typedef R (T::*MemberSignature)(A1) const;

 private:
  const T* object_;
  MemberSignature member_;

 public:
  inline _ConstTessMemberResultCallback_0_1(
     const T* object, MemberSignature member)
    : object_(object),
      member_(member) {
  }

  virtual R Run(A1 a1) {
    if (!del) {
      R result = (object_->*member_)(a1);
      return result;
    } else {
      R result = (object_->*member_)(a1);
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
      return result;
    }
  }
};

template <bool del, class T, class A1>
class _ConstTessMemberResultCallback_0_1<del, void, T, A1>
  : public TessCallback1<A1> {
 public:
  typedef TessCallback1<A1> base;
  typedef void (T::*MemberSignature)(A1) const;

 private:
  const T* object_;
  MemberSignature member_;

 public:
  inline _ConstTessMemberResultCallback_0_1(
      const T* object, MemberSignature member)
    : object_(object),
      member_(member) {
  }

  virtual void Run(A1 a1) {
    if (!del) {
      (object_->*member_)(a1);
    } else {
      (object_->*member_)(a1);
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
    }
  }
};

#ifndef SWIG
template <class T1, class T2, class R, class A1>
inline typename _ConstTessMemberResultCallback_0_1<true,R,T1,A1>::base*
NewTessCallback(
    const T1* obj, R (T2::*member)(A1) const) {
  return new _ConstTessMemberResultCallback_0_1<true,R,T1,A1>(
      obj, member);
}
#endif

#ifndef SWIG
template <class T1, class T2, class R, class A1>
inline typename _ConstTessMemberResultCallback_0_1<false,R,T1,A1>::base*
NewPermanentTessCallback(
    const T1* obj, R (T2::*member)(A1) const) {
  return new _ConstTessMemberResultCallback_0_1<false,R,T1,A1>(
      obj, member);
}
#endif

template <bool del, class R, class T, class A1>
class _TessMemberResultCallback_0_1 : public TessResultCallback1<R,A1> {
 public:
  typedef TessResultCallback1<R,A1> base;
  typedef R (T::*MemberSignature)(A1) ;

 private:
   T* object_;
  MemberSignature member_;

 public:
  inline _TessMemberResultCallback_0_1(
      T* object, MemberSignature member)
    : object_(object),
      member_(member) {
  }

  virtual R Run(A1 a1) {
    if (!del) {
      R result = (object_->*member_)(a1);
      return result;
    } else {
      R result = (object_->*member_)(a1);
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
      return result;
    }
  }
};

template <bool del, class T, class A1>
class _TessMemberResultCallback_0_1<del, void, T, A1>
  : public TessCallback1<A1> {
 public:
  typedef TessCallback1<A1> base;
  typedef void (T::*MemberSignature)(A1) ;

 private:
   T* object_;
  MemberSignature member_;

 public:
  inline _TessMemberResultCallback_0_1(
       T* object, MemberSignature member)
    : object_(object),
      member_(member) {
  }

  virtual void Run(A1 a1) {
    if (!del) {
      (object_->*member_)(a1);
    } else {
      (object_->*member_)(a1);
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
    }
  }
};

#ifndef SWIG
template <class T1, class T2, class R, class A1>
inline typename _TessMemberResultCallback_0_1<true,R,T1,A1>::base*
NewTessCallback(
     T1* obj, R (T2::*member)(A1) ) {
  return new _TessMemberResultCallback_0_1<true,R,T1,A1>(
      obj, member);
}
#endif

#ifndef SWIG
template <class T1, class T2, class R, class A1>
inline typename _TessMemberResultCallback_0_1<false,R,T1,A1>::base*
NewPermanentTessCallback(
     T1* obj, R (T2::*member)(A1) ) {
  return new _TessMemberResultCallback_0_1<false,R,T1,A1>(
      obj, member);
}
#endif

template <bool del, class R, class A1>
class _TessFunctionResultCallback_0_1 : public TessResultCallback1<R,A1> {
 public:
  typedef TessResultCallback1<R,A1> base;
  typedef R (*FunctionSignature)(A1);

 private:
  FunctionSignature function_;

 public:
  inline _TessFunctionResultCallback_0_1(
      FunctionSignature function)
    : function_(function) {
  }

  virtual R Run(A1 a1) {
    if (!del) {
      R result = (*function_)(a1);
      return result;
    } else {
      R result = (*function_)(a1);
      //  zero out the pointer to ensure segfault if used again
      function_ = NULL;
      delete this;
      return result;
    }
  }
};

template <bool del, class A1>
class _TessFunctionResultCallback_0_1<del, void, A1>
  : public TessCallback1<A1> {
 public:
  typedef TessCallback1<A1> base;
  typedef void (*FunctionSignature)(A1);

 private:
  FunctionSignature function_;

 public:
  inline _TessFunctionResultCallback_0_1(
      FunctionSignature function)
    : function_(function) {
  }

  virtual void Run(A1 a1) {
    if (!del) {
      (*function_)(a1);
    } else {
      (*function_)(a1);
      //  zero out the pointer to ensure segfault if used again
      function_ = NULL;
      delete this;
    }
  }
};

template <class R, class A1>
inline typename _TessFunctionResultCallback_0_1<true,R,A1>::base*
NewTessCallback(R (*function)(A1)) {
  return new _TessFunctionResultCallback_0_1<true,R,A1>(function);
}

template <class R, class A1>
inline typename _TessFunctionResultCallback_0_1<false,R,A1>::base*
NewPermanentTessCallback(R (*function)(A1)) {
  return new _TessFunctionResultCallback_0_1<false,R,A1>(function);
}

template <class A1,class A2>
class TessCallback2 {
 public:
  virtual ~TessCallback2() { }
  virtual void Run(A1,A2) = 0;
};

template <class R, class A1,class A2>
class TessResultCallback2 {
 public:
  virtual ~TessResultCallback2() { }
  virtual R Run(A1,A2) = 0;
};

template <bool del, class R, class T, class A1, class A2>
class _ConstTessMemberResultCallback_0_2 : public TessResultCallback2<R,A1,A2> {
 public:
  typedef TessResultCallback2<R,A1,A2> base;
  typedef R (T::*MemberSignature)(A1,A2) const;

 private:
  const T* object_;
  MemberSignature member_;

 public:
  inline _ConstTessMemberResultCallback_0_2(
     const T* object, MemberSignature member)
    : object_(object),
      member_(member) {
  }

  virtual R Run(A1 a1,A2 a2) {
    if (!del) {
      R result = (object_->*member_)(a1,a2);
      return result;
    } else {
      R result = (object_->*member_)(a1,a2);
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
      return result;
    }
  }
};

template <bool del, class T, class A1, class A2>
class _ConstTessMemberResultCallback_0_2<del, void, T, A1, A2>
  : public TessCallback2<A1,A2> {
 public:
  typedef TessCallback2<A1,A2> base;
  typedef void (T::*MemberSignature)(A1,A2) const;

 private:
  const T* object_;
  MemberSignature member_;

 public:
  inline _ConstTessMemberResultCallback_0_2(
      const T* object, MemberSignature member)
    : object_(object),
      member_(member) {
  }

  virtual void Run(A1 a1,A2 a2) {
    if (!del) {
      (object_->*member_)(a1,a2);
    } else {
      (object_->*member_)(a1,a2);
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
    }
  }
};

#ifndef SWIG
template <class T1, class T2, class R, class A1, class A2>
inline typename _ConstTessMemberResultCallback_0_2<true,R,T1,A1,A2>::base*
NewTessCallback(
    const T1* obj, R (T2::*member)(A1,A2) const) {
  return new _ConstTessMemberResultCallback_0_2<true,R,T1,A1,A2>(
      obj, member);
}
#endif

#ifndef SWIG
template <class T1, class T2, class R, class A1, class A2>
inline typename _ConstTessMemberResultCallback_0_2<false,R,T1,A1,A2>::base*
NewPermanentTessCallback(
    const T1* obj, R (T2::*member)(A1,A2) const) {
  return new _ConstTessMemberResultCallback_0_2<false,R,T1,A1,A2>(
      obj, member);
}
#endif

template <bool del, class R, class T, class A1, class A2>
class _TessMemberResultCallback_0_2 : public TessResultCallback2<R,A1,A2> {
 public:
  typedef TessResultCallback2<R,A1,A2> base;
  typedef R (T::*MemberSignature)(A1,A2) ;

 private:
   T* object_;
  MemberSignature member_;

 public:
  inline _TessMemberResultCallback_0_2(
      T* object, MemberSignature member)
    : object_(object),
      member_(member) {
  }

  virtual R Run(A1 a1,A2 a2) {
    if (!del) {
      R result = (object_->*member_)(a1,a2);
      return result;
    } else {
      R result = (object_->*member_)(a1,a2);
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
      return result;
    }
  }
};

template <bool del, class T, class A1, class A2>
class _TessMemberResultCallback_0_2<del, void, T, A1, A2>
  : public TessCallback2<A1,A2> {
 public:
  typedef TessCallback2<A1,A2> base;
  typedef void (T::*MemberSignature)(A1,A2) ;

 private:
   T* object_;
  MemberSignature member_;

 public:
  inline _TessMemberResultCallback_0_2(
       T* object, MemberSignature member)
    : object_(object),
      member_(member) {
  }

  virtual void Run(A1 a1,A2 a2) {
    if (!del) {
      (object_->*member_)(a1,a2);
    } else {
      (object_->*member_)(a1,a2);
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
    }
  }
};

#ifndef SWIG
template <class T1, class T2, class R, class A1, class A2>
inline typename _TessMemberResultCallback_0_2<true,R,T1,A1,A2>::base*
NewTessCallback(
     T1* obj, R (T2::*member)(A1,A2) ) {
  return new _TessMemberResultCallback_0_2<true,R,T1,A1,A2>(
      obj, member);
}
#endif

#ifndef SWIG
template <class T1, class T2, class R, class A1, class A2>
inline typename _TessMemberResultCallback_0_2<false,R,T1,A1,A2>::base*
NewPermanentTessCallback(
     T1* obj, R (T2::*member)(A1,A2) ) {
  return new _TessMemberResultCallback_0_2<false,R,T1,A1,A2>(
      obj, member);
}
#endif

template <bool del, class R, class A1, class A2>
class _TessFunctionResultCallback_0_2 : public TessResultCallback2<R,A1,A2> {
 public:
  typedef TessResultCallback2<R,A1,A2> base;
  typedef R (*FunctionSignature)(A1,A2);

 private:
  FunctionSignature function_;

 public:
  inline _TessFunctionResultCallback_0_2(
      FunctionSignature function)
    : function_(function) {
  }

  virtual R Run(A1 a1,A2 a2) {
    if (!del) {
      R result = (*function_)(a1,a2);
      return result;
    } else {
      R result = (*function_)(a1,a2);
      //  zero out the pointer to ensure segfault if used again
      function_ = NULL;
      delete this;
      return result;
    }
  }
};

template <bool del, class A1, class A2>
class _TessFunctionResultCallback_0_2<del, void, A1, A2>
  : public TessCallback2<A1,A2> {
 public:
  typedef TessCallback2<A1,A2> base;
  typedef void (*FunctionSignature)(A1,A2);

 private:
  FunctionSignature function_;

 public:
  inline _TessFunctionResultCallback_0_2(
      FunctionSignature function)
    : function_(function) {
  }

  virtual void Run(A1 a1,A2 a2) {
    if (!del) {
      (*function_)(a1,a2);
    } else {
      (*function_)(a1,a2);
      //  zero out the pointer to ensure segfault if used again
      function_ = NULL;
      delete this;
    }
  }
};

template <class R, class A1, class A2>
inline typename _TessFunctionResultCallback_0_2<true,R,A1,A2>::base*
NewTessCallback(R (*function)(A1,A2)) {
  return new _TessFunctionResultCallback_0_2<true,R,A1,A2>(function);
}

template <class R, class A1, class A2>
inline typename _TessFunctionResultCallback_0_2<false,R,A1,A2>::base*
NewPermanentTessCallback(R (*function)(A1,A2)) {
  return new _TessFunctionResultCallback_0_2<false,R,A1,A2>(function);
}

template <class A1,class A2,class A3>
class TessCallback3 {
 public:
  virtual ~TessCallback3() { }
  virtual void Run(A1,A2,A3) = 0;
};

template <class R, class A1,class A2,class A3>
class TessResultCallback3 {
 public:
  virtual ~TessResultCallback3() { }
  virtual R Run(A1,A2,A3) = 0;
};

template <bool del, class R, class T, class A1, class A2, class A3>
class _ConstTessMemberResultCallback_0_3 : public TessResultCallback3<R,A1,A2,A3> {
 public:
  typedef TessResultCallback3<R,A1,A2,A3> base;
  typedef R (T::*MemberSignature)(A1,A2,A3) const;

 private:
  const T* object_;
  MemberSignature member_;

 public:
  inline _ConstTessMemberResultCallback_0_3(
     const T* object, MemberSignature member)
    : object_(object),
      member_(member) {
  }

  virtual R Run(A1 a1,A2 a2,A3 a3) {
    if (!del) {
      R result = (object_->*member_)(a1,a2,a3);
      return result;
    } else {
      R result = (object_->*member_)(a1,a2,a3);
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
      return result;
    }
  }
};

template <bool del, class T, class A1, class A2, class A3>
class _ConstTessMemberResultCallback_0_3<del, void, T, A1, A2, A3>
  : public TessCallback3<A1,A2,A3> {
 public:
  typedef TessCallback3<A1,A2,A3> base;
  typedef void (T::*MemberSignature)(A1,A2,A3) const;

 private:
  const T* object_;
  MemberSignature member_;

 public:
  inline _ConstTessMemberResultCallback_0_3(
      const T* object, MemberSignature member)
    : object_(object),
      member_(member) {
  }

  virtual void Run(A1 a1,A2 a2,A3 a3) {
    if (!del) {
      (object_->*member_)(a1,a2,a3);
    } else {
      (object_->*member_)(a1,a2,a3);
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
    }
  }
};

#ifndef SWIG
template <class T1, class T2, class R, class A1, class A2, class A3>
inline typename _ConstTessMemberResultCallback_0_3<true,R,T1,A1,A2,A3>::base*
NewTessCallback(
    const T1* obj, R (T2::*member)(A1,A2,A3) const) {
  return new _ConstTessMemberResultCallback_0_3<true,R,T1,A1,A2,A3>(
      obj, member);
}
#endif

#ifndef SWIG
template <class T1, class T2, class R, class A1, class A2, class A3>
inline typename _ConstTessMemberResultCallback_0_3<false,R,T1,A1,A2,A3>::base*
NewPermanentTessCallback(
    const T1* obj, R (T2::*member)(A1,A2,A3) const) {
  return new _ConstTessMemberResultCallback_0_3<false,R,T1,A1,A2,A3>(
      obj, member);
}
#endif

template <bool del, class R, class T, class A1, class A2, class A3>
class _TessMemberResultCallback_0_3 : public TessResultCallback3<R,A1,A2,A3> {
 public:
  typedef TessResultCallback3<R,A1,A2,A3> base;
  typedef R (T::*MemberSignature)(A1,A2,A3) ;

 private:
   T* object_;
  MemberSignature member_;

 public:
  inline _TessMemberResultCallback_0_3(
      T* object, MemberSignature member)
    : object_(object),
      member_(member) {
  }

  virtual R Run(A1 a1,A2 a2,A3 a3) {
    if (!del) {
      R result = (object_->*member_)(a1,a2,a3);
      return result;
    } else {
      R result = (object_->*member_)(a1,a2,a3);
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
      return result;
    }
  }
};

template <bool del, class T, class A1, class A2, class A3>
class _TessMemberResultCallback_0_3<del, void, T, A1, A2, A3>
  : public TessCallback3<A1,A2,A3> {
 public:
  typedef TessCallback3<A1,A2,A3> base;
  typedef void (T::*MemberSignature)(A1,A2,A3) ;

 private:
   T* object_;
  MemberSignature member_;

 public:
  inline _TessMemberResultCallback_0_3(
       T* object, MemberSignature member)
    : object_(object),
      member_(member) {
  }

  virtual void Run(A1 a1,A2 a2,A3 a3) {
    if (!del) {
      (object_->*member_)(a1,a2,a3);
    } else {
      (object_->*member_)(a1,a2,a3);
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
    }
  }
};

#ifndef SWIG
template <class T1, class T2, class R, class A1, class A2, class A3>
inline typename _TessMemberResultCallback_0_3<true,R,T1,A1,A2,A3>::base*
NewTessCallback(
     T1* obj, R (T2::*member)(A1,A2,A3) ) {
  return new _TessMemberResultCallback_0_3<true,R,T1,A1,A2,A3>(
      obj, member);
}
#endif

#ifndef SWIG
template <class T1, class T2, class R, class A1, class A2, class A3>
inline typename _TessMemberResultCallback_0_3<false,R,T1,A1,A2,A3>::base*
NewPermanentTessCallback(
     T1* obj, R (T2::*member)(A1,A2,A3) ) {
  return new _TessMemberResultCallback_0_3<false,R,T1,A1,A2,A3>(
      obj, member);
}
#endif

template <bool del, class R, class A1, class A2, class A3>
class _TessFunctionResultCallback_0_3 : public TessResultCallback3<R,A1,A2,A3> {
 public:
  typedef TessResultCallback3<R,A1,A2,A3> base;
  typedef R (*FunctionSignature)(A1,A2,A3);

 private:
  FunctionSignature function_;

 public:
  inline _TessFunctionResultCallback_0_3(
      FunctionSignature function)
    : function_(function) {
  }

  virtual R Run(A1 a1,A2 a2,A3 a3) {
    if (!del) {
      R result = (*function_)(a1,a2,a3);
      return result;
    } else {
      R result = (*function_)(a1,a2,a3);
      //  zero out the pointer to ensure segfault if used again
      function_ = NULL;
      delete this;
      return result;
    }
  }
};

template <bool del, class A1, class A2, class A3>
class _TessFunctionResultCallback_0_3<del, void, A1, A2, A3>
  : public TessCallback3<A1,A2,A3> {
 public:
  typedef TessCallback3<A1,A2,A3> base;
  typedef void (*FunctionSignature)(A1,A2,A3);

 private:
  FunctionSignature function_;

 public:
  inline _TessFunctionResultCallback_0_3(
      FunctionSignature function)
    : function_(function) {
  }

  virtual void Run(A1 a1,A2 a2,A3 a3) {
    if (!del) {
      (*function_)(a1,a2,a3);
    } else {
      (*function_)(a1,a2,a3);
      //  zero out the pointer to ensure segfault if used again
      function_ = NULL;
      delete this;
    }
  }
};

template <class R, class A1, class A2, class A3>
inline typename _TessFunctionResultCallback_0_3<true,R,A1,A2,A3>::base*
NewTessCallback(R (*function)(A1,A2,A3)) {
  return new _TessFunctionResultCallback_0_3<true,R,A1,A2,A3>(function);
}

template <class R, class A1, class A2, class A3>
inline typename _TessFunctionResultCallback_0_3<false,R,A1,A2,A3>::base*
NewPermanentTessCallback(R (*function)(A1,A2,A3)) {
  return new _TessFunctionResultCallback_0_3<false,R,A1,A2,A3>(function);
}

// Specified by TR1 [4.7.2] Reference modifications.
//template <class T> struct remove_reference;
//template<typename T> struct remove_reference { typedef T type; };
template<typename T> struct remove_reference<T&> { typedef T type; };

// Identity<T>::type is a typedef of T. Useful for preventing the
// compiler from inferring the type of an argument in templates.
template <typename T>
struct Identity {
  typedef T type;
};

template <bool del, class R, class T, class P1, class A1, class A2>
class _ConstTessMemberResultCallback_1_2
  : public TessResultCallback2<R,A1,A2> {
 public:
  typedef TessResultCallback2<R,A1,A2> base;
  typedef R (T::*MemberSignature)(P1,A1,A2) const;

 private:
   T* object_;
  MemberSignature member_;
  typename remove_reference<P1>::type p1_;

 public:
  inline _ConstTessMemberResultCallback_1_2(T* object,
                                            MemberSignature member, P1 p1)
    : object_(object), member_(member), p1_(p1) { }

  virtual R Run(A1 a1, A2 a2) {
    if (!del) {
      R result = (object_->*member_)(p1_,a1,a2);
      return result;
    } else {
      R result = (object_->*member_)(p1_,a1,a2);
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
      return result;
    }
  }
};

template <bool del, class T, class P1, class A1, class A2>
class _ConstTessMemberResultCallback_1_2<del, void, T, P1, A1, A2>
  : public TessCallback2<A1,A2> {
 public:
  typedef TessCallback2<A1,A2> base;
  typedef void (T::*MemberSignature)(P1,A1,A2) const;

 private:
   T* object_;
  MemberSignature member_;
  typename remove_reference<P1>::type p1_;

 public:
  inline _ConstTessMemberResultCallback_1_2(T* object,
                                            MemberSignature member, P1 p1)
    : object_(object), member_(member), p1_(p1) { }

  virtual void Run(A1 a1, A2 a2) {
    if (!del) {
      (object_->*member_)(p1_,a1,a2);
    } else {
      (object_->*member_)(p1_,a1,a2);
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
    }
  }
};

#ifndef SWIG
template <class T1, class T2, class R, class P1, class A1, class A2>
inline typename _ConstTessMemberResultCallback_1_2<true,R,T1,P1,A1,A2>::base*
NewTessCallback( T1* obj, R (T2::*member)(P1,A1,A2) , typename Identity<P1>::type p1) {
  return new _ConstTessMemberResultCallback_1_2<true,R,T1,P1,A1,A2>(obj, member, p1);
}
#endif

#ifndef SWIG
template <class T1, class T2, class R, class P1, class A1, class A2>
inline typename _ConstTessMemberResultCallback_1_2<false,R,T1,P1,A1,A2>::base*
NewPermanentTessCallback( T1* obj, R (T2::*member)(P1,A1,A2) , typename Identity<P1>::type p1) {
  return new _ConstTessMemberResultCallback_1_2<false,R,T1,P1,A1,A2>(obj, member, p1);
}
#endif

template <bool del, class R, class T, class P1, class A1, class A2>
class _TessMemberResultCallback_1_2 : public TessResultCallback2<R,A1,A2> {
 public:
  typedef TessResultCallback2<R,A1,A2> base;
  typedef R (T::*MemberSignature)(P1,A1,A2) ;

 private:
   T* object_;
  MemberSignature member_;
  typename remove_reference<P1>::type p1_;

 public:
  inline _TessMemberResultCallback_1_2(T* object,
                                        MemberSignature member, P1 p1)
    : object_(object), member_(member), p1_(p1) { }

  virtual R Run(A1 a1, A2 a2) {
    if (!del) {
      R result = (object_->*member_)(p1_,a1,a2);
      return result;
    } else {
      R result = (object_->*member_)(p1_,a1,a2);
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
      return result;
    }
  }
};

template <bool del, class T, class P1, class A1, class A2>
class _TessMemberResultCallback_1_2<del, void, T, P1, A1, A2>
  : public TessCallback2<A1,A2> {
 public:
  typedef TessCallback2<A1,A2> base;
  typedef void (T::*MemberSignature)(P1,A1,A2) ;

 private:
   T* object_;
  MemberSignature member_;
  typename remove_reference<P1>::type p1_;

 public:
  inline _TessMemberResultCallback_1_2(T* object,
                                        MemberSignature member, P1 p1)
    : object_(object), member_(member), p1_(p1) { }

  virtual void Run(A1 a1, A2 a2) {
    if (!del) {
      (object_->*member_)(p1_,a1,a2);
    } else {
      (object_->*member_)(p1_,a1,a2);
      //  zero out the pointer to ensure segfault if used again
      member_ = NULL;
      delete this;
    }
  }
};

#ifndef SWIG
template <class T1, class T2, class R, class P1, class A1, class A2>
inline typename _TessMemberResultCallback_1_2<true,R,T1,P1,A1,A2>::base*
NewTessCallback( T1* obj, R (T2::*member)(P1,A1,A2) , typename Identity<P1>::type p1) {
  return new _TessMemberResultCallback_1_2<true,R,T1,P1,A1,A2>(obj, member, p1);
}
#endif

#ifndef SWIG
template <class T1, class T2, class R, class P1, class A1, class A2>
inline typename _TessMemberResultCallback_1_2<false,R,T1,P1,A1,A2>::base*
NewPermanentTessCallback( T1* obj, R (T2::*member)(P1,A1,A2) , typename Identity<P1>::type p1) {
  return new _TessMemberResultCallback_1_2<false,R,T1,P1,A1,A2>(obj, member, p1);
}
#endif

template <bool del, class R, class P1, class A1, class A2>
class _TessFunctionResultCallback_1_2 : public TessCallback2<A1,A2> {
 public:
  typedef TessCallback2<A1,A2> base;
  typedef R (*FunctionSignature)(P1,A1,A2);

 private:
  FunctionSignature function_;
  typename remove_reference<P1>::type p1_;

 public:
  inline _TessFunctionResultCallback_1_2(FunctionSignature function, P1 p1)
    : function_(function), p1_(p1) { }

  virtual R Run(A1 a1, A2 a2) {
    if (!del) {
      R result = (*function_)(p1_,a1,a2);
      return result;
    } else {
      R result = (*function_)(p1_,a1,a2);
      //  zero out the pointer to ensure segfault if used again
      function_ = NULL;
      delete this;
      return result;
    }
  }
};

template <bool del, class P1, class A1, class A2>
class _TessFunctionResultCallback_1_2<del, void, P1, A1, A2>
  : public TessCallback2<A1,A2> {
 public:
  typedef TessCallback2<A1,A2> base;
  typedef void (*FunctionSignature)(P1,A1,A2);

 private:
  FunctionSignature function_;
  typename remove_reference<P1>::type p1_;

 public:
  inline _TessFunctionResultCallback_1_2(FunctionSignature function, P1 p1)
    : function_(function), p1_(p1) { }

  virtual void Run(A1 a1, A2 a2) {
    if (!del) {
      (*function_)(p1_,a1,a2);
    } else {
      (*function_)(p1_,a1,a2);
      //  zero out the pointer to ensure segfault if used again
      function_ = NULL;
      delete this;
    }
  }
};

template <class R, class P1, class A1, class A2>
inline typename _TessFunctionResultCallback_1_2<true,R,P1,A1,A2>::base*
NewTessCallback(R (*function)(P1,A1,A2), typename Identity<P1>::type p1) {
  return new _TessFunctionResultCallback_1_2<true,R,P1,A1,A2>(function, p1);
}

template <class R, class P1, class A1, class A2>
inline typename _TessFunctionResultCallback_1_2<false,R,P1,A1,A2>::base*
NewPermanentTessCallback(R (*function)(P1,A1,A2), typename Identity<P1>::type p1) {
  return new _TessFunctionResultCallback_1_2<false,R,P1,A1,A2>(function, p1);
}

#endif /* _TESS_CALLBACK_SPECIALIZATIONS_H */

The strange thing is that I have changed nothing in the tesseract code from the first project to the second project, and this error is appearing just by adding the include directories to the project.

I am using VS2010 in Windows 7.

Any ideas about what is happening?

Thank you in advance.

You will probably find there is a missing semi-colon in your code right before this code is included

You will probably find there is a missing semi-colon in your code right before this code is included

Hi and thanks for your reply. Do you mean that my own code is missing a semi-colon? I don't think that's the problem. I mean, I have my project working and after just adding the headers of this library and trying to compile (without changing a line in the code), the errors appear. Then you may think: OK it's a problem of the external headers. But the most confusing part is that the same headers are working in a different testing project.

So, could it be a wrong configuration or a conflict between files?

If you're saying this library works in code-A, but does not work in code-B (and gives an error of a missing semi-colon), the problem must be with code-B.

Another test (hard way to go) would be to make a very simple code-C and link this library to it.
If it does not error, the problem is absolutely with code-B.

The semi-colon error will also appear when there is a missing (or extra) parenthesis.

Most of the IDE's may tell you the line where you got these errors. Also as stated by the errors, fixing it is just a simple thing. At least for now you know what the problem is. That is the begining of the solution. :-)

First, thank you to both of you, I answer below:

If you're saying this library works in code-A, but does not work in code-B (and gives an error of a missing semi-colon), the problem must be with code-B.

Another test (hard way to go) would be to make a very simple code-C and link this library to it.
If it does not error, the problem is absolutely with code-B.

The semi-colon error will also appear when there is a missing (or extra) parenthesis.

Yes, I understand that the problem is with code-B, but what I don't understand is why is giving an error if I am changing nothing in the code. Just to be clear:

- I downloaded this external library.
- I created a new project (the one you call code-A) with VS2010 and added openCV and this external library (adding headers and libs).
- I wrote few lines of code using this library. Compiles OK and works.
- I opened my bigger project (code-B), that has also openCV and run it. Compiles OK and works.
- I added the headers and libs of the external library in the properties panel, the same way as I did in code-A, and I do not add or change anything in the code-B. If I try to compile, it gives the errors mentioned.

I know that I might be repiting myself, but I don't understand where is the problem in code-B, as I am writing nothing new, just adding the headers (that are compiling in code-A) in the properties of the project.

Most of the IDE's may tell you the line where you got these errors. Also as stated by the errors, fixing it is just a simple thing. At least for now you know what the problem is. That is the begining of the solution. :-)

You are right, the line where the problem apperas is number 1011, the one in bold in the following code:

template <class R, class A1, class A2, class A3>
inline typename _TessFunctionResultCallback_0_3<false,R,A1,A2,A3>::base*
NewPermanentTessCallback(R (*function)(A1,A2,A3)) {
  return new _TessFunctionResultCallback_0_3<false,R,A1,A2,A3>(function);
}
 
// Specified by TR1 [4.7.2] Reference modifications.
//template <class T> struct remove_reference;
//template<typename T> struct remove_reference { typedef T type; };
[B]template<typename T> struct remove_reference<T&> { typedef T type; };[/B]
 
// Identity<T>::type is a typedef of T. Useful for preventing the
// compiler from inferring the type of an argument in templates.
template <typename T>
struct Identity {
  typedef T type;
};

Maybe I am missing a semi-colon or whatever, but I have to say (again, sorry for being so repetitive :) ) that this code is compiling in code-A, and I have changed nothing on it.

Best regards.

Yes, I agree it does not make sense (until we actually figure out what it is).
It could be a define (or typedef) or a multitude of things.
You can also just comment out sections of code and re-compile until the problem stops, then identify the singular piece that's causing the problem.

Yes, I agree it does not make sense (until we actually figure out what it is).
It could be a define (or typedef) or a multitude of things.
You can also just comment out sections of code and re-compile until the problem stops, then identify the singular piece that's causing the problem.

Thank you for your answer. Yes, the first thing I did (before posting here) was to comment the line that was giving the error, but then I got more errors:

1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1030): error C2143: syntax error : missing ';' before '<'
1>          c:\projects\tesseract-ocr\ccutil\tesscallback.h(1049) : see reference to class template instantiation '_ConstTessMemberResultCallback_1_2<del,R,T,P1,A1,A2>' being compiled
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1030): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1030): error C2238: unexpected token(s) preceding ';'
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1061): error C2143: syntax error : missing ';' before '<'
1>          c:\projects\tesseract-ocr\ccutil\tesscallback.h(1078) : see reference to class template instantiation '_ConstTessMemberResultCallback_1_2<del,void,T,P1,A1,A2>' being compiled
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1061): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1061): error C2238: unexpected token(s) preceding ';'
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1105): error C2143: syntax error : missing ';' before '<'
1>          c:\projects\tesseract-ocr\ccutil\tesscallback.h(1124) : see reference to class template instantiation '_TessMemberResultCallback_1_2<del,R,T,P1,A1,A2>' being compiled
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1105): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1105): error C2238: unexpected token(s) preceding ';'
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1136): error C2143: syntax error : missing ';' before '<'
1>          c:\projects\tesseract-ocr\ccutil\tesscallback.h(1153) : see reference to class template instantiation '_TessMemberResultCallback_1_2<del,void,T,P1,A1,A2>' being compiled
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1136): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1136): error C2238: unexpected token(s) preceding ';'
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1179): error C2143: syntax error : missing ';' before '<'
1>          c:\projects\tesseract-ocr\ccutil\tesscallback.h(1197) : see reference to class template instantiation '_TessFunctionResultCallback_1_2<del,R,P1,A1,A2>' being compiled
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1179): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1179): error C2238: unexpected token(s) preceding ';'
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1208): error C2143: syntax error : missing ';' before '<'
1>          c:\projects\tesseract-ocr\ccutil\tesscallback.h(1224) : see reference to class template instantiation '_TessFunctionResultCallback_1_2<del,void,P1,A1,A2>' being compiled
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1208): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\projects\tesseract-ocr\ccutil\tesscallback.h(1208): error C2238: unexpected token(s) preceding ';'
1>c:\projects\tesseract-ocr\ccstruct\ocrblock.h(23): fatal error C1083: Cannot open include file: 'img.h': No such file or directory

If I comment that line that is giving the new error, a newer error appears in a new line, and so on. As you have suggested, I have commented all the lines that are giving that kind of error, then I just get this error: 1>c:\projects\tesseract-ocr\ccstruct\ocrblock.h(23): fatal error C1083: Cannot open include file: 'img.h': No such file or directory What make no sense for me, because I didn't need to include that file in the code-A. But anyway, if I include that file, then it asks for a new file (scrollview.h). Then it asks for one more file (oldlist.h). After adding all those files (all of them are from this external library), I get this error: 1>c:\projects\tesseract-ocr\ccutil\unicharset.h(64): error C3861: 'snprintf': identifier not found And also new errors related to other libraries that has no relationship with the external library I am trying to use.

I can try to continue adding and deleting things, but I think that this behaviour is not desirable, as it was much easier to do it in code-A.

Any ideas with those new errors?

Thank you.

Look at the thi...

template <class R, class A1, class A2, class A3>
inline typename _TessFunctionResultCallback_0_3<false,R,A1,A2,A3>::base*
NewPermanentTessCallback(R (*function)(A1,A2,A3)) {
  return new _TessFunctionResultCallback_0_3<false,R,A1,A2,A3>(function);
}

notice that you used class for the

template <class R, class A1, class A2, class A3>

but you have use a typename for the method. Atleast either you use a class for type or the typename keyword to make things uniform.

also until one got the full code to compile and run. detecting errors like this is eternal work.

First, thank you to both of you, I answer below:

Yes, I understand that the problem is with code-B, but what I don't understand is why is giving an error if I am changing nothing in the code. Just to be clear:

- I downloaded this external library.
- I created a new project (the one you call code-A) with VS2010 and added openCV and this external library (adding headers and libs).
- I wrote few lines of code using this library. Compiles OK and works.
- I opened my bigger project (code-B), that has also openCV and run it. Compiles OK and works.
- I added the headers and libs of the external library in the properties panel, the same way as I did in code-A, and I do not add or change anything in the code-B. If I try to compile, it gives the errors mentioned.

I know that I might be repiting myself, but I don't understand where is the problem in code-B, as I am writing nothing new, just adding the headers (that are compiling in code-A) in the properties of the project.

You are right, the line where the problem apperas is number 1011, the one in bold in the following code:

template <class R, class A1, class A2, class A3>
inline typename _TessFunctionResultCallback_0_3<false,R,A1,A2,A3>::base*
NewPermanentTessCallback(R (*function)(A1,A2,A3)) {
  return new _TessFunctionResultCallback_0_3<false,R,A1,A2,A3>(function);
}
 
// Specified by TR1 [4.7.2] Reference modifications.
//template <class T> struct remove_reference;
//template<typename T> struct remove_reference { typedef T type; };
[B]template<typename T> struct remove_reference<T&> { typedef T type; };[/B]
 
// Identity<T>::type is a typedef of T. Useful for preventing the
// compiler from inferring the type of an argument in templates.
template <typename T>
struct Identity {
  typedef T type;
};

Maybe I am missing a semi-colon or whatever, but I have to say (again, sorry for being so repetitive :) ) that this code is compiling in code-A, and I have changed nothing on it.

Best regards.

Looks like you have not given the path for your included files. If you have moved your files then provide the new path like
#include "../<folder name>/<filename>"

P.S. The file should be in the same folder as that of your project.
What IDE are you using?

Look at the thi...

template <class R, class A1, class A2, class A3>
inline typename _TessFunctionResultCallback_0_3<false,R,A1,A2,A3>::base*
NewPermanentTessCallback(R (*function)(A1,A2,A3)) {
  return new _TessFunctionResultCallback_0_3<false,R,A1,A2,A3>(function);
}

notice that you used class for the

template <class R, class A1, class A2, class A3>

but you have use a typename for the method. Atleast either you use a class for type or the typename keyword to make things uniform.

also until one got the full code to compile and run. detecting errors like this is eternal work.

Thanks for replying. I don't understand very well what you are saying. Anyway, it is again the same thing. Maybe the code is wrong, but the strange thing is that the same code works in project A, but not in project B.

Looks like you have not given the path for your included files. If you have moved your files then provide the new path like
#include "../<folder name>/<filename>"

P.S. The file should be in the same folder as that of your project.
What IDE are you using?

Thanks for replying, but I don't think that's the reason for the problem. I have not moved anything and it is not asking for any header files. As I have said in the first post, I am using VisualStudio 2010.


I am still stuck in this problem, any other ideas?

Best regards

Commenting out the line where the compiler is complaining, internal to a huge header that works fine in another project, is not the correct approach. Instead try commenting out items preceding the #include for this library -- other #includes before this one? I suspect that a different header is declaring one of the variables used at/near the offending line, or worse, #define'ing a macro with that name, e.g. (a stupid example):

#define R Circumference/(2*3.1415926)

Then the definition in the lines immediately before your offending line become

template <class Circumference/(2*3.1415966), class A1, class A2, class A3>
...

which is clearly unusable. And would presumably cause a completely different error message. But something along those lines is entirely possible. Try including all the dependencies for your larger project-B into a new empty project-D that just has an empty main() that doesn't actually do anything. See if that compiles. If not, start removing one dependency at a time (and re-adding it as soon as you've tested), until you find the one causing the problem. (You can't do this in project-B because there's presumably code that requires each of the dependencies you're including.)

Commenting out the line where the compiler is complaining, internal to a huge header that works fine in another project, is not the correct approach. Instead try commenting out items preceding the #include for this library -- other #includes before this one? I suspect that a different header is declaring one of the variables used at/near the offending line, or worse, #define'ing a macro with that name, e.g. (a stupid example):

#define R Circumference/(2*3.1415926)

Then the definition in the lines immediately before your offending line become

template <class Circumference/(2*3.1415966), class A1, class A2, class A3>
...

which is clearly unusable. And would presumably cause a completely different error message. But something along those lines is entirely possible. Try including all the dependencies for your larger project-B into a new empty project-D that just has an empty main() that doesn't actually do anything. See if that compiles. If not, start removing one dependency at a time (and re-adding it as soon as you've tested), until you find the one causing the problem. (You can't do this in project-B because there's presumably code that requires each of the dependencies you're including.)

Hello, thanks for your reply. Sorry for being so late in the answer, but I have been busy with other coding problems and I was not able to check this one.

You are completely right, creating a new project and testing all includes makes sense for me. As it makes sense, I have tried today and I have just found the solution to my problem. It seems that dshow.h is giving a conflict. I have that header included in a couple of headers and I have solved the problem by changing:

#include <dshow.h>

for:

#include <strmif.h>
#include <uuids.h>

And also don't forget to add (which was missing in one of my headers):

#pragma comment(lib,"Strmiids.lib")

Those changes have worked for me, so thank you for your suggestion about testing step by step.

And also thank you to the rest of people who have helped in this problem.

Cheers!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.