Thread: QVector declaration does not see type as a correct type

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    3

    QVector declaration does not see type as a correct type

    Hi,
    First of all I'd like to say Hello Forum! as I'm a new guy in town

    Now, there is an amazing Open Dynamics Engine library (Open Dynamics Engine - home) that I just wanted to mess around but when compiling one of its tutorial sources I get the error which I cannot overcome: Index of /Membres/Xavier.Decoret/resources/ode/tutorial1/D

    While compiling (Ubuntu 9.04) I get the following error:
    viewer.h:26: error: ISO C++ forbids declaration of 'QVector' with no type.

    Sure, but the type is provided:
    7: class Object; //class declaration
    26: QVector <Object*> _objects;

    I prepared an example with std::vector aside and it can be created with Object*, QVector does not differ in this matter.

    The object.h/cpp is correctly compiled.

    What is wrong in this example?

    Best Regards,
    Tomek

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Where is the type for QVector? The compiler hasn't seen any declaration/definition for QVector, hence the error.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Aug 2009
    Posts
    3
    Quote Originally Posted by Elysia View Post
    Where is the type for QVector? The compiler hasn't seen any declaration/definition for QVector, hence the error.
    Uhh, I don't think it's the lack of QVector declaration. The QVector declration comes down from
    <code>#include <QGLViewer/qglviewer.h></code>

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    That's what it says. QVector has no type.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Registered User
    Join Date
    Oct 2006
    Posts
    250
    Just #include <QVector>

  6. #6
    Registered User
    Join Date
    Aug 2009
    Posts
    3
    Thank you! It was indeed lack of QVector declaration, I should not argue with wiser people :-)

    The QVector itself was in Qt2.x, then in Qt3 it was obsolete and in Qt4 again implemented, this made me confused, obviously the tutorial was for Qt2.x while I'm using Qt3.x

    Thank you once again!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cant find the error
    By Coder87C in forum C Programming
    Replies: 8
    Last Post: 06-19-2005, 01:57 AM
  2. header file bringing errors?
    By bluehead in forum Windows Programming
    Replies: 4
    Last Post: 08-19-2003, 12:51 PM
  3. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM
  4. odd errors from msvc std library files
    By blight2c in forum C++ Programming
    Replies: 6
    Last Post: 04-30-2002, 12:06 AM
  5. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 06:51 PM