Menu

IVT-1.3.6+Ubuntu9.10+OpenCV+QT+QTGui+OpenGL

Help
2009-11-14
2013-05-09
  • Leadro Pavón Serrano

    Hi, I'm a Spanish student. I study Telecomunications Enginering and i want to do a virtual blackboard application using OpenCV and QTGui.

    When I saw IVT I thinked I could to use it.
    I want to setup the IVT in Ubuntu 9.10 Karmic Koala.

    I set to 1 in the Makefile.base the flags for use OpenGL, OpenCV, V4L, GTK, QT, and QTGui.

    When I run make in /IVT/src/ I had a bug in a file on /IVT/src/gui/GLContext.h, it miss #include <stdio.h> for use printf function. I add it and I solved the bug.

    But other bug in QCoreEvent.h I can't solved. In this file comments, It's say if you get a error with NONE it's probably because you use X11 libraries, you need include it after QT includes for solved.

    Can anyone help me please?

     
  • Pedram Azad

    Pedram Azad - 2009-11-17

    Hi,

    1. /IVT/src/gui/GLContext.cpp contains #include <stdio.h> for the printf function. /IVT/src/gui/GLContext.h does not contain any printf. So I am wondering why you need that include in the header file. Could you give me more detailed information on what the problem was?

    2. Here, I also need detailed information (e.g. the errors listed by the compiler).

    Just to make sure: You have to decide whether you'd like to use the GTK implementation or the QT implementation for the IVT GUI toolkit. So please make sure to either set USE_QT = 0, USE_QTGUI = 0, USE_GTKGUI = 1, or USE_QT = 1, USE_QTGUI = 1, USE_GTKGUI = 0.

    Both implementations are fine. If you are having trouble with Qt, you might want to try with GTK.

    Best,
    Pedram

     
  • Leadro Pavón Serrano

    Hi Pedram, thank you for you speedy response.

    2. Sorry, when I said GLContext.h I wanted to say /IVT/src/gui/GLContext.cpp, It DON'T contains #include <stdio.h> for the printf function.
    In /IVT/src/gui/GLContext.cpp header only there are:

    >     #include "GLContext.h"
    >     #include "Image/ByteImage.h"
    >     #include <memory.h>

    The compiler error its the next:

        g++ -O3  -D_REENTRANT    -DUSE_OPENGL -DUSE_GTKGUI -I../../src -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I/usr/include/opencv   -I. -c gui/GLContext.cpp -o build/gl_context.o
        gui/GLContext.cpp: In member function ‘bool CGLContext::CreateContext(int, int, void*)’:
        gui/GLContext.cpp:574: error: ‘printf’ was not declared in this scope
        gui/GLContext.cpp:580: error: ‘printf’ was not declared in this scope
        gui/GLContext.cpp:592: error: ‘printf’ was not declared in this scope
        gui/GLContext.cpp:601: error: ‘printf’ was not declared in this scope
        gui/GLContext.cpp:610: error: ‘printf’ was not declared in this scope
        gui/GLContext.cpp:623: error: ‘printf’ was not declared in this scope
        gui/GLContext.cpp: In member function ‘bool CGLContext::GetImage(CByteImage*)’:
        gui/GLContext.cpp:699: error: ‘printf’ was not declared in this scope
        make: ***  Error 1


    2.-
    I had througth the GTKGUI is used in GNOME and QTGUI in KDE, i.e.
    Can I use ony a kind of GUI? This it's my error? If your response is yes, I want to suggest add this connotation in the Makefile.base file.

    When I set USE_QTGUI = 1 and USE_GTKGUI = 1 my compiler error it's the next:

        g++ -O3  -DQT_SHARED   -D_REENTRANT    -DUSE_OPENGL -DUSE_GTKGUI -DUSE_QTGUI -I../../src -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL   -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I/usr/include/opencv   -I. -c gui/GLContext.cpp -o build/gl_context.o
        In file included from /usr/include/qt4/QtCore/qcoreapplication.h:46,
                         from /usr/include/qt4/QtGui/qapplication.h:45,
                         from gui/GLContext.cpp:253:
        /usr/include/qt4/QtCore/qcoreevent.h:84: error: expected identifier before numeric constant
        /usr/include/qt4/QtCore/qcoreevent.h:84: error: expected ‘}’ before numeric constant
        /usr/include/qt4/QtCore/qcoreevent.h:84: error: expected unqualified-id before numeric constant
        /usr/include/qt4/QtCore/qcoreevent.h:294: error: expected ‘)’ before ‘type’
        /usr/include/qt4/QtCore/qcoreevent.h:295: error: declaration of ‘~QEvent’ as non-member
        /usr/include/qt4/QtCore/qcoreevent.h:296: error: ‘Type’ does not name a type
        /usr/include/qt4/QtCore/qcoreevent.h:297: error: non-member function ‘bool spontaneous()’ cannot have cv-qualifier
        /usr/include/qt4/QtCore/qcoreevent.h: In function ‘bool spontaneous()’:
        /usr/include/qt4/QtCore/qcoreevent.h:297: error: ‘spont’ was not declared in this scope
        /usr/include/qt4/QtCore/qcoreevent.h: In function ‘void setAccepted(bool)’:
        /usr/include/qt4/QtCore/qcoreevent.h:299: error: ‘m_accept’ was not declared in this scope
        /usr/include/qt4/QtCore/qcoreevent.h: At global scope:
        /usr/include/qt4/QtCore/qcoreevent.h:300: error: non-member function ‘bool isAccepted()’ cannot have cv-qualifier
        /usr/include/qt4/QtCore/qcoreevent.h: In function ‘bool isAccepted()’:
        /usr/include/qt4/QtCore/qcoreevent.h:300: error: ‘m_accept’ was not declared in this scope
        /usr/include/qt4/QtCore/qcoreevent.h: In function ‘void accept()’:
        /usr/include/qt4/QtCore/qcoreevent.h:302: error: ‘m_accept’ was not declared in this scope
        /usr/include/qt4/QtCore/qcoreevent.h: In function ‘void ignore()’:
        /usr/include/qt4/QtCore/qcoreevent.h:303: error: ‘m_accept’ was not declared in this scope
        /usr/include/qt4/QtCore/qcoreevent.h: At global scope:
        /usr/include/qt4/QtCore/qcoreevent.h:307: error: expected unqualified-id before ‘protected’
        /usr/include/qt4/QtCore/qcoreevent.h:311: error: expected unqualified-id before ‘private’
        /usr/include/qt4/QtCore/qcoreevent.h:313: error: expected initializer before ‘:’ token
        /usr/include/qt4/QtCore/qcoreevent.h:314: error: expected initializer before ‘:’ token
        /usr/include/qt4/QtCore/qcoreevent.h:315: error: expected initializer before ‘:’ token
        /usr/include/qt4/QtCore/qcoreevent.h:317: error: ‘friend’ used outside of class
        /usr/include/qt4/QtCore/qcoreevent.h:318: error: ‘friend’ used outside of class
        /usr/include/qt4/QtCore/qcoreevent.h:319: error: ‘friend’ used outside of class
        /usr/include/qt4/QtCore/qcoreevent.h:320: error: ‘friend’ used outside of class
        /usr/include/qt4/QtCore/qcoreevent.h:321: error: ‘friend’ used outside of class
        /usr/include/qt4/QtCore/qcoreevent.h:322: error: ‘friend’ used outside of class
        /usr/include/qt4/QtCore/qcoreevent.h:323: error: ‘friend’ used outside of class
        /usr/include/qt4/QtCore/qcoreevent.h:324: error: ‘friend’ used outside of class
        /usr/include/qt4/QtCore/qcoreevent.h:325: error: expected declaration before ‘}’ token
        make: ***  Error 1

    In /usr/include/qt4/QtCore/qcoreevent.h file, there are the next comment:
    (NONE = 0 it's the 84 line)

        class QEventPrivate;
        class Q_CORE_EXPORT QEvent           // event base class
        {
            QDOC_PROPERTY(bool accepted READ isAccepted WRITE setAccepted)
        public:
            enum Type {
                /*
                  If you get a strange compiler error on the line with None,
                  it's probably because you're also including X11 headers,
                  which #define the symbol None. Put the X11 includes after
                  the Qt includes to solve this problem.
                */
                None = 0,                               // invalid event
                Timer = 1,                              // timer event

    In the qcoreevent.h header I add:

        #include "qx11embed_x11.h"
        #include <qapplication.h>
        #include <qevent.h>
        #include <qpainter.h>
        #include <qlayout.h>
        #include <qstyle.h>
        #include <qstyleoption.h>
        #include <qdatetime.h>
        #include <qpointer.h>
        #include <qdebug.h>
        #include <qx11info_x11.h>
        #include <X11/Xlib.h>
        #include <X11/Xatom.h>
        #include <X11/Xutil.h>
        #include <X11/keysymdef.h>
        #include <X11/X.h>
    But the compiler said the same error.

    When I set USEGTKGUI = 1 only, IVT compile good.

    When I set USE_QT = 1 USE_QTGUI = 0 USE_GTKGUI = 1, IVT compile good too.

    When I set USE_QT = 1 USE_QTGUI = 1 USE_GTKGUI = 0, IVT compile good.

    Sorry, I am thinking the errors aren't bugs, and I am newbie, that's why i have problems. I never want to say about IVT it's bugs code, I'm exciting  to use IVT in my proyect.

     
  • Pedram Azad

    Pedram Azad - 2009-11-18

    Hi Leadro,

    1. You must be using an older version of the IVT. The current version 1.3.6 contains the #include <stdio.h> in line 50 of /IVT/src/gui/GLContext.cpp, I just checked.

    2. I will add a comment both in the documentation on installation as well as in Makefile.base itself. Only on GUI implementation can be activated at a time.

    And no problem, comments and feedback are always welcome!

    Pedram

     

Log in to post a comment.