Menu

Help compiling under Qt5.8

Help
2017-01-29
2017-01-29
  • Brad Elliott

    Brad Elliott - 2017-01-29

    I'm trying to compile against QT 5.8 and it doesn't seem to like the 5.6 version of the wrappers:

    pythonqt_build_win32\pythonqtcode\generated_cpp_56\com_trolltech_qt_core_builtin\com_trolltech_qt_core_builtin0.h(1275) : error C2039: 'WindowOkButtonHint' : is not a member of 'Qt'
    pythonqt_build_win32\pythonqtcode\generated_cpp_56\com_trolltech_qt_core_builtin\com_trolltech_qt_core_builtin0.h(1275) : error C2039: 'WindowCancelButtonHint' : is not a member of 'Qt'
    

    I thought I'd try to regenerate the generated_cpp directory but I can't seem to get it to work:

    set QTDIR="C:\usr\tools\qt\5.8\msvc2013"
    cd generator
    pythonqt_generator.exe
    

    This doesn't appear to find anything. I get the output below. I can't seem to find instructions for running pythonqt_generator.exe

    pythonqt_build_win32\pythonqtcode\generator>pythonqt_generator.exe
    WARNING() :: Duplicate type entry: 'QMultimedia'
    Please wait while source files are being generated...
    Parsing typesystem file [:/trolltech/generator/build_all.txt]
    PreProcessing - Generate [.preprocessed.tmp] using [:/trolltech/generator/qtscript_masterinclude.h] and include-paths []
    -------------------------------------------------------------
    Using QT at: "C:\usr\tools\qt\5.8\msvc2013"
    -------------------------------------------------------------
    WARNING(MetaJavaBuilder) :: ShellImplGenerator: no java classes, skipping
    WARNING(MetaJavaBuilder) :: ShellHeaderGenerator: no java classes, skipping
    Building model using [.preprocessed.tmp]
    Classes in typesystem: 0
    Generated:
      - header....: 0 (0)
      - impl......: 0 (0)
      - modules...: 0 (0)
      - pri.......: 0 (0)
    
    Done, 3 warnings (1720 known issues)
    

    I tried specifying the include path which got me a bit farther but it seems to run into a lot of errors:

    pythonqt_build_win32\pythonqtcode\generator>pythonqt_generator.exe --include-paths="C:\usr\tools\qt\5.8\msvc2013\include" 
    WARNING() :: Duplicate type entry: 'QMultimedia'
    Please wait while source files are being generated...
    Parsing typesystem file [:/trolltech/generator/build_all.txt]
    PreProcessing - Generate [.preprocessed.tmp] using [:/trolltech/generator/qtscript_masterinclude.h] and include-paths [C:\usr\tools\qt\5.8\msvc2013\include]
    -------------------------------------------------------------
    Using QT at: "C:\usr\tools\qt\5.8\msvc2013"
    -------------------------------------------------------------
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 10
    ** WARNING expected ``)'' = 10
    ** WARNING expected ``)'' = 10
    ** WARNING expected ``)'' = 10
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    ** WARNING expected ``)'' = 1002
    Building model using [.preprocessed.tmp]
    ** WARNING scope not found for symbol:_Num_base::has_denorm
    ** WARNING scope not found for symbol:_Num_base::has_denorm_loss
    ** WARNING scope not found for symbol:_Num_base::has_infinity
    ** WARNING scope not found for symbol:_Num_base::has_quiet_NaN
    ** WARNING scope not found for symbol:_Num_base::has_signaling_NaN
    ** WARNING scope not found for symbol:_Num_base::is_bounded
    ** WARNING scope not found for symbol:_Num_base::is_exact
    ** WARNING scope not found for symbol:_Num_base::is_iec559
    ** WARNING scope not found for symbol:_Num_base::is_integer
    ** WARNING scope not found for symbol:_Num_base::is_modulo
    ** WARNING scope not found for symbol:_Num_base::is_signed
    ** WARNING scope not found for symbol:_Num_base::is_specialized
    ** WARNING scope not found for symbol:_Num_base::tinyness_before
    ** WARNING scope not found for symbol:_Num_base::traps
    ** WARNING scope not found for symbol:_Num_base::round_style
    

    Any instructions for re-running the generator?

     
  • Florian Link

    Florian Link - 2017-01-29

    I haven't tried Qt 5.8 yet. If the two enums are the only errors, it is easiest if you just remove them from the enum wrapper manually and rebuild.
    Please tell me it works, I can remove the enums on svn trunk as well if it works, since they are for Windows CE only.

    Regarding the wrappers, did you install Qt with full headers files? How did the last run end?
    I will try running the generator myself tomorrow.

     
  • Florian Link

    Florian Link - 2017-01-30

    I removed the two enum items, apart from that the Qt 5.6 wrappers work fine with Qt 5.8.

     
  • Florian Link

    Florian Link - 2017-01-31

    Looks like the C++ parser of PythonQt can only handle Qt up to 5.6.
    Qt 5.7 starts using C++ 11 features, which the C++ parser of the PythonQt generator can not handle.
    I inherited the C++ parser from QtJambi and QtScript wrappers several years ago.
    I saw that the PySide guys are working on integrating clang as a C++ parser instead (they are using the same C++ parser as PythonQt does at the moment).
    If they succeed (which I am quite sure), I will probably switch to the PySide APIExtractor
    as well. Until then, we have to live with the Qt 5.6 wrappers and keep them compiling on Qt 5.7/5.8/...

     
  • Fredrik Jonsson

    Fredrik Jonsson - 2017-02-01

    Hi, I had the same issue, but in addition to modifying the WindowOkButtonHint and WindowCancelButtonHint I needed to do the following modifications:

    In src\PythonQtConversion.cpp line 1507
    Add missing ;

    In src\PythonQtSlotDecorator.cpp line 45,
    Add "const" to the declaration
    and on line 47 in the same file do a typecast to (char * * ) for the kwlist argument.

    After these modification compilation and examples worked fine.
    I am using MSVC2015.

    Is there a better way to get things working?

     
  • Florian Link

    Florian Link - 2017-02-02

    The svn trunk of PythonQt already contains these changes, so if you check out the sources it should now compile out of the box with Qt 5.8

     
  • Florian Link

    Florian Link - 2017-02-02

    Looks like the PythonQt parser could not handle the QOpenGLFunctions since changes in Qt 5.7/5.8.
    I ignored those files in the generator now and generation on Qt 5.8 seems to work again.

    Anyways, in the long run I will need a C++ parser that can handle C++11 and I am probably following PySide in what they are going to use.

     
  • Luigi Alberti

    Luigi Alberti - 2017-03-16

    Dear Florian, dear all,
    I'm using PythonQt very sucesfully for scripting purpose in my appplication. It is a really powerful tool and I really apreciate it a lot. I normaly work with Unix-like system, i.e. Linux and macos. On both systems I never had issues compiling PythonQt.
    I'm now working to port my application (its, koil here on sourceforge) on windows....and I encounter a lot of issues in setting up the correct toolchain. I apologize if this could appear a stupid issue, but I'm stucking in trying to understand the correct step by step procedure to follow in order to have a fresh and running toolchain to compile qt based application using PythonQt under windows (on mac and linux no problem at all!).
    When working on windows, I normally use mingw. I understood that this is not the designed way for PythonQt and I should move to MSVC compiler. Then I found some posts describing the necessity to re-compile both Python and qt with the same compiler version. Even if I try different combination I never reach a working solution.
    Therefore, I kindly ask the comunity support in order to provide "step by step" instructions for newbie like me in windows compiling (including proper download links would be ideal) to install all the required toolchain (compiler, qt libraries, python itself, PythonQt,...). Mybe such request sounds "stupid" or trivial to some more expert users, bu I think such a "installation tutorial" would be very appreciated by many other people that is at the begining of apporaching PythonQt (at least on windows system).
    Many thanks and regards
    Luigi

     
    • Sergey

      Sergey - 2017-03-29

      Hi, Luigi!
      To build PythonQt in Windows with mingw, do the following:
      1) comment out these lines in C:\Qt\Tools\mingw492_32\i686-w64-mingw32\include\c++\cmath:

      //using ::hypot;
      //using ::hypotf;
      //using ::hypotl;
      (see https://sourceforge.net/p/pythonqt/discussion/631392/thread/188d4e7c/#4818).

      2) create environment variables
      PYTHON_PATH = c:\Python27
      PYTHON_LIB = c:\Python27\libs

      3) in python.prf set python version:
      win32:PYTHON_VERSION=27
      unix:PYTHON_VERSION=2.7

      and change the line (preffix "lib" and suffix "a")
      win32:LIBS += $$(PYTHON_LIB)/libpython$${PYTHON_VERSION}$${DEBUG_EXT}.a

      4) common.prf:
      CONFIG += release

      5) PythonQt_QtAll.prf (similarly libPythonQt_QtAll.a):
      win32::LIBS += $$PWD/../lib/libPythonQt_QtAll$${DEBUG_EXT}.a

      6) PythonQt.prf (libPythonQt.a):
      win32::LIBS += $$PWD/../lib/libPythonQt$${DEBUG_EXT}.a

      7) in src.pri comment out (or delete) the line:
      win32:QMAKE_CXXFLAGS += /bigobj

      8) in src\gui\PythonQtScriptingConsole.cpp, PythonQtScriptingConsole::executeCode:
      toLatin1 replace to toUtf8

      9 ) in src\PythonQt.cpp, PythonQt::evalScript:
      toLatin1 replace to toUtf8

      10) qmake
      mingw32-make

      Good luck!
      Sergey.

       
  • Ed Chapman

    Ed Chapman - 2017-06-27

    Great product PythonQT loving it, Has anyone having any success at building it from a Shadow Build Directory? Like from QtCreator. Examples don't expect the libs to be outside the Python directories proper, and link errors.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.