vector <t_vertice> puntos; [modified]
-
The following code on a linux gcc compiler gave me an error message: error - SO C++ forbids declaration of "vector" with no type apparently, vector dd; is okay because double is a known type How can I make g++ recognize t_vertice as a valid type? Or how can I switch off the ISO compatibilty on the g++ compiler? _________________________________________________ #ifndef HSI3D_H #define HSI3D_H #include #include #include #include "../imageplus.h" #include class HSI3D : public QGLWidget { Q_OBJECT public: HSI3D(QWidget *parent=0, const char *name=0); HSI3D(const ImagePlus &Image, QWidget *parent=0, const char *name=0); ~HSI3D(); typedef struct t_vertice{ uchar red; uchar green; uchar blue; float h; uchar s; uchar i; }t_vertice, *ptrtvertice; vector puntos; int quants_punts; -- modified at 0:02 Thursday 1st March, 2007
-
The following code on a linux gcc compiler gave me an error message: error - SO C++ forbids declaration of "vector" with no type apparently, vector dd; is okay because double is a known type How can I make g++ recognize t_vertice as a valid type? Or how can I switch off the ISO compatibilty on the g++ compiler? _________________________________________________ #ifndef HSI3D_H #define HSI3D_H #include #include #include #include "../imageplus.h" #include class HSI3D : public QGLWidget { Q_OBJECT public: HSI3D(QWidget *parent=0, const char *name=0); HSI3D(const ImagePlus &Image, QWidget *parent=0, const char *name=0); ~HSI3D(); typedef struct t_vertice{ uchar red; uchar green; uchar blue; float h; uchar s; uchar i; }t_vertice, *ptrtvertice; vector puntos; int quants_punts; -- modified at 0:02 Thursday 1st March, 2007
Can modify your code with ignore html tags option ? So that it can be readable, understandable.
Prasad Notifier using ATL | Operator new[],delete[][^]
-
The following code on a linux gcc compiler gave me an error message: error - SO C++ forbids declaration of "vector" with no type apparently, vector dd; is okay because double is a known type How can I make g++ recognize t_vertice as a valid type? Or how can I switch off the ISO compatibilty on the g++ compiler? _________________________________________________ #ifndef HSI3D_H #define HSI3D_H #include #include #include #include "../imageplus.h" #include class HSI3D : public QGLWidget { Q_OBJECT public: HSI3D(QWidget *parent=0, const char *name=0); HSI3D(const ImagePlus &Image, QWidget *parent=0, const char *name=0); ~HSI3D(); typedef struct t_vertice{ uchar red; uchar green; uchar blue; float h; uchar s; uchar i; }t_vertice, *ptrtvertice; vector puntos; int quants_punts; -- modified at 0:02 Thursday 1st March, 2007
George Lam wrote:
typedef struct t_vertice{ uchar red; uchar green; uchar blue; float h; uchar s; uchar i; }t_vertice, *ptrtvertice;
I've never worked on linux. But, just a suggestion. Can you try, moving this typedef outside the class ?
Prasad Notifier using ATL | Operator new[],delete[][^]
-
George Lam wrote:
typedef struct t_vertice{ uchar red; uchar green; uchar blue; float h; uchar s; uchar i; }t_vertice, *ptrtvertice;
I've never worked on linux. But, just a suggestion. Can you try, moving this typedef outside the class ?
Prasad Notifier using ATL | Operator new[],delete[][^]
no go, still same error message
-
The following code on a linux gcc compiler gave me an error message: error - SO C++ forbids declaration of "vector" with no type apparently, vector dd; is okay because double is a known type How can I make g++ recognize t_vertice as a valid type? Or how can I switch off the ISO compatibilty on the g++ compiler? _________________________________________________ #ifndef HSI3D_H #define HSI3D_H #include #include #include #include "../imageplus.h" #include class HSI3D : public QGLWidget { Q_OBJECT public: HSI3D(QWidget *parent=0, const char *name=0); HSI3D(const ImagePlus &Image, QWidget *parent=0, const char *name=0); ~HSI3D(); typedef struct t_vertice{ uchar red; uchar green; uchar blue; float h; uchar s; uchar i; }t_vertice, *ptrtvertice; vector puntos; int quants_punts; -- modified at 0:02 Thursday 1st March, 2007
I've never used gcc but searching on the error message it seems the likely culprit is "vector" is not defined, usually because of a missing header or a namespace problem. If you have the right header(s) included, maybe "std::vector" will work. std::vector puntos; or using std::vector; ... vector puntos; Mark -- modified at 14:32 Thursday 1st March, 2007