|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello,
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 /Applications/openCV/OpenCV.framework/Headers/cxtypes.h:549: error: expected ';' before '*' token /Applications/openCV/OpenCV.framework/Headers/cxtypes.h: In function 'CvMat cvMat(int, int, int, void*)': /Applications/openCV/OpenCV.framework/Headers/cxtypes.h:625: error: 'union CvMat::<anonymous>' has no member named 'ptr' /Applications/openCV/OpenCV.framework/Headers/cxtypes.h:625: error: 'uchar' was not declared in this scope /Applications/openCV/OpenCV.framework/Headers/cxtypes.h:625: error: expected primary-expression before ')' token /Applications/openCV/OpenCV.framework/Headers/cxtypes.h:625: error: expected `;' before 'data' /Applications/openCV/OpenCV.framework/Headers/cxtypes.h: In function 'double cvmGet(const CvMat*, int, int)': /Applications/openCV/OpenCV.framework/Headers/cxtypes.h:654: error: 'const union CvMat::<anonymous>' has no member named 'ptr' /Applications/openCV/OpenCV.framework/Headers/cxtypes.h:658: error: 'const union CvMat::<anonymous>' has no member named 'ptr' /Applications/openCV/OpenCV.framework/Headers/cxtypes.h: In function 'void cvmSet(CvMat*, int, int, double)': /Applications/openCV/OpenCV.framework/Headers/cxtypes.h:671: error: 'union CvMat::<anonymous>' has no member named 'ptr' /Applications/openCV/OpenCV.framework/Headers/cxtypes.h:675: error: 'union CvMat::<anonymous>' has no member named 'ptr' /Applications/openCV/OpenCV.framework/Headers/cxtypes.h: At global scope: /Applications/openCV/OpenCV.framework/Headers/cxtypes.h:708: error: ISO C++ forbids declaration of 'uchar' with no type .... ... .... any suggestion ? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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. -- Roland Pibinger "The best software is simple, elegant, and full of drama" - Grady Booch |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Jun 30, 1:27am, Greg Herlihy <gre...@mac.com> wrote:
> 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 Hi, well I tried to add typedef unsigned char uchar; before but I still have the same error. The thing is that "typedef unsigned char uchar;" *IS* in a header file in which i got the error. I don't understand why the compiler complains that it is not defined. This is the header: #ifndef _CXCORE_TYPES_H_ #define _CXCORE_TYPES_H_ ... #ifndef HAVE_IPL typedef unsigned char uchar; typedef unsigned short ushort; #endif ... union { uchar* ptr; <-- error short* s; int* i; float* fl; double* db; } I also tried to remove the if condition before typedef but still have the same error |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
On Jun 30, 9:14pm, aneuryzma <patrick.divia...@gmail.com> wrote:
> On Jun 30, 1:27am, Greg Herlihy <gre...@mac.com> wrote: > > > > > 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 > > Hi, > > well I tried to add typedef unsigned char uchar; before but I still > have the same error. > > The thing is that "typedef unsigned char uchar;" *IS* in a header file > in which i got the error. I don't understand why the compiler > complains that it is not defined. > > This is the header: > > #ifndef _CXCORE_TYPES_H_ > #define _CXCORE_TYPES_H_ > > ... > > #ifndef HAVE_IPL > typedef unsigned char uchar; > typedef unsigned short ushort; > #endif > > ... > > union > { > uchar* ptr; <-- error > short* s; > int* i; > float* fl; > double* db; > } > > I also tried to remove the if condition before typedef but still have > the same error I just want to remark that everything works perfectly if I build only the openCV application. I think there is some kind of conflict on the uchar variable. |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
On Mon, 30 Jun 2008 12:14:15 -0700 (PDT), aneuryzma wrote:
>The thing is that "typedef unsigned char uchar;" *IS* in a header file >in which i got the error. I don't understand why the compiler >complains that it is not defined. > >This is the header: > >#ifndef _CXCORE_TYPES_H_ >#define _CXCORE_TYPES_H_ > > >#ifndef HAVE_IPL <-- !!! >typedef unsigned char uchar; >typedef unsigned short ushort; >#endif Do you define HAVE_IPL (e.g. -DHAVE_IPL in the makefile)? |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
On Jun 30, 3:18pm, aneuryzma <patrick.divia...@gmail.com> wrote:
[snip] > I just want to remark that everything works perfectly if I build only > the openCV application. I think there is some kind of conflict on the > uchar variable. Right. So what you want to do now is create the smallest possible chunk of source code that demonstrates the error. Make a copy of the source files. "Hand" do the includes to get down to a single file that still shows the error. Then start the old "divide and rule." Take out half the source code and see if the error goes away. Bin-search on it till you get down to five or ten lines or so. Should not take you more than 10 or 15 divides. If the error does not become obvious this way, post back a short example. Socks |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
On Jun 30, 9:58pm, Puppet_Sock <puppet_s...@hotmail.com> wrote:
> On Jun 30, 3:18pm, aneuryzma <patrick.divia...@gmail.com> wrote: > [snip] > > > I just want to remark that everything works perfectly if I build only > > the openCV application. I think there is some kind of conflict on the > > uchar variable. > > Right. > > So what you want to do now is create the smallest possible > chunk of source code that demonstrates the error. > > Make a copy of the source files. "Hand" do the includes > to get down to a single file that still shows the error. > > Then start the old "divide and rule." Take out half the > source code and see if the error goes away. Bin-search > on it till you get down to five or ten lines or so. > Should not take you more than 10 or 15 divides. > > If the error does not become obvious this way, post back > a short example. > Socks Hi, well, I think I solved just including openCV before and ogre3d later. Do you know a cross-platform multithread *light* library that I can use to run both application simultaneously ? thanks! |
|
![]() |
| Outils de la discussion | |
|
|