Afficher un message
Vieux 30/06/2008, 01h27   #3
Greg Herlihy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
 
Page generated in 0,05036 seconds with 9 queries