Adding Qt libraries to existing game engine



  • Hello,
    I would like some advice on how I should proceed.
    I'm trying to add Qt bindings to the Tesseract engine . The engine is basically mostly graphics, I want to try and expand the server side using Qt.
    I successfully ported the Makefile to qmake, (and it was quite an endeavor by itself...).
    Now I need to exchange data between Tesseract and Qt, so I'm trying to #include Qt in the Tesseract source files, but Tesseract uses a lot of globals and I get a crazy amount of errors like this:

    In file included from ../tesseract-nightly2/src/qt/bridge.h:16:0,
                     from ../tesseract-nightly2/src/qt/hooks.h:5,
                     from ../tesseract-nightly2/src/qt/hooks.cpp:1:
    ../tesseract-nightly2/src/shared/tools.h: In function 'void* operator new(size_t, void*)':
    ../tesseract-nightly2/src/shared/tools.h:36:14: error: redefinition of 'void* operator new(size_t, void*)'
     inline void *operator new(size_t, void *p) { return p; }
                  ^
    In file included from E:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/bits/stl_construct.h:59:0,
                     from E:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/bits/stl_tempbuf.h:60,
                     from E:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/bits/stl_algo.h:62,
                     from E:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/algorithm:62,
                     from ../../../Qt/5.6/mingw49_32/include/QtCore/qglobal.h:85,
                     from ../../../Qt/5.6/mingw49_32/include/QtCore/qcoreapplication.h:37,
                     from ../../../Qt/5.6/mingw49_32/include/QtCore/QCoreApplication:1,
                     from ../tesseract-nightly2/src/qt/hooks.h:4,
                     from ../tesseract-nightly2/src/qt/hooks.cpp:1:
    E:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/new:146:14: note: 'void* operator new(std::size_t, void*)' previously defined here
     inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                  ^
    In file included from ../tesseract-nightly2/src/qt/bridge.h:16:0,
                     from ../tesseract-nightly2/src/qt/hooks.h:5,
                     from ../tesseract-nightly2/src/qt/hooks.cpp:1:
    ../tesseract-nightly2/src/shared/tools.h: In function 'void* operator new [](size_t, void*)':
    ../tesseract-nightly2/src/shared/tools.h:37:14: error: redefinition of 'void* operator new [](size_t, void*)'
     inline void *operator new[](size_t, void *p) { return p; }
                  ^
    In file included from E:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/bits/stl_construct.h:59:0,
                     from E:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/bits/stl_tempbuf.h:60,
                     from E:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/bits/stl_algo.h:62,
                     from E:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/algorithm:62,
                     from ../../../Qt/5.6/mingw49_32/include/QtCore/qglobal.h:85,
                     from ../../../Qt/5.6/mingw49_32/include/QtCore/qcoreapplication.h:37,
                     from ../../../Qt/5.6/mingw49_32/include/QtCore/QCoreApplication:1,
                     from ../tesseract-nightly2/src/qt/hooks.h:4,
                     from ../tesseract-nightly2/src/qt/hooks.cpp:1:
    E:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/new:148:14: note: 'void* operator new [](std::size_t, void*)' previously defined here
     inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
    [...]
    

    How would you suggest I go on? Is there some way I could try to avoid these collisions between Tesseract sources and Qt? Can you eventually point me to some work somewhat similar to what I'm trying to achieve?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.