Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. vector <t_vertice> puntos; [modified]

vector <t_vertice> puntos; [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++graphicslinux
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    George Lam
    wrote on last edited by
    #1

    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

    P M 3 Replies Last reply
    0
    • G George Lam

      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

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      Can modify your code with ignore html tags option ? So that it can be readable, understandable.

      Prasad Notifier using ATL | Operator new[],delete[][^]

      1 Reply Last reply
      0
      • G George Lam

        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

        P Offline
        P Offline
        prasad_som
        wrote on last edited by
        #3

        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[][^]

        G 1 Reply Last reply
        0
        • P prasad_som

          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[][^]

          G Offline
          G Offline
          George Lam
          wrote on last edited by
          #4

          no go, still same error message

          1 Reply Last reply
          0
          • G George Lam

            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

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups