Re: "ISO C++ forbids declaration of uchar with no type"
On Jun 29, 2:52pm, rpbg...@yahoo.com (Roland Pibinger) wrote:
> On Sun, 29 Jun 2008 14:26:57 -0700 (PDT), aneuryzma wrote:
> >I'm merging an OpenCV app with an Ogre3d app. I'm on a mac, I'm using
> >xCode.
>
> >When I add #include "openCVApp.h"
>
> >I got the following error:
>
> >"Applications/openCV/OpenCV.framework/Headers/cxtypes.h:549: error:
> >ISO C++ forbids declaration of 'uchar' with no type
>
> include the header that defines 'uchar' before openCVApp.h.
Or, if no such header can be found, define the "uchar" typedef
yourself - before including openCVApp.h:
typedef unsigned char uchar;
// ...
#include "openCVApp.h"
Even if the header with the "uchar" typedef is eventually found and
included - having an extra "uchar" typedef in the same translation
unit should not be a problem. A C++ program is free to define the same
typedef, multiple times within a single scope - provided that the
typedef is defined the same way each time.
Greg
|