I am trying to build PythonQt for the past hours and I am failing at it. Consider me a noob at commandline stuff.
When building like it is said on the website, I run qmake.exe which compiles till a certain point where it exits with an error: bigobj not found. I also had an error at rcc.exe not found/prefix incorrect (or some sorts, can't seem to get this error again). I then thought shit, I am compiling with Qt 5.5, so I switched to the qmake.exe of Qt 5.4, since that is the latest version I see mentioned in the changelogs. This build crashes even earlier, stating #include <QtCore QString=""> not found (eventhough I can see QString in QtCore).
I set the paths (using python 2.7) prior to running vcvars32.
I am guessing it is something very obvious I am missing, but I have no clue. Help would be greatly appreciated.
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, thanks for the quick reply.
Now the build fails at : 'C:\Qt\5.5\mingw492_32\bin\rcc.exe' -name generator generator.qrc -o release/qrc_generator.cpp
The filename, directory name, or volume label syntax is incorrect. NMAKE: fatal error U1077: ''C:\Qt\5.5\mingw492_32\bin\rcc.exe'' : return code '0x01'
Using Qt 5.5 qmake.exe. If I use Qt 5.4 qmake.exe I get #include <QtCore/QString> not found
I have no idea why it doesnt see QString nor why it fails at rcc.exe, help would be much appreciated.
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Now I get an error : c:\Python27\libs/libPython27.a: no such file or directory
Looking at the error I changed Python.prf: LIBS +=$$(PYTHON_LIB)/libpython$${PYTHON_VERSION}$${DEBUG_EXT}.a
to LIBS += $$(PYTHON_LIB)/python$${PYTHON_VERSION}$${DEBUG_EXT}.lib
This made it continue until a boatload of errors where thrown like these: ./release/PythonQt.o:PythonQt.cpp:<.text+0x01776>: undefined reference to '_imp__PyInt_Type' ./release/PythonQt.o:PythonQt.cpp:<.text+0x01776>: undefined reference to '_imp__PyType_Type' ./release/PythonQt.o:PythonQt.cpp:<.text+0x01776>: undefined reference to '_imp__PyModule_Type'
Thanks for helping me out here @Sergey :)
Edit: Googling a bit I found:
1. Download the Python source package. Note: Even if you should be using the exact same compiler as the pre-built python package, there's no debug library available in that package and you cannot build the debug library from the pre-built version.
2. Compile Python with the compiler you used for building Qt.
3. Set the PYTHONVERSION and PYTHONPATH variables as described within the PythonQt readme.
4. Compile PythonQt with the same compiler you used to compile Qt and Python.
I downloaded the prebuilt python package (installer), would this be the cause of the problem?
Last edit: Poep Hoofd 2015-09-30
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Using the .msi I indeed now have the libpython27.a. The build now continues further until it hits this error:
c:\Python27\libs/libpython27.a(dmmes00343.o):<.idata$7+0x0>: undefined reference to '_head_C__build27_cpython_PCBuild_libpython27_a'
Google gave me no useful advice. I tried completely reinstalling python, rebooting, building a freshly extracted pythonQt and fiddling around with the .prf files without succes. I'm sure you are getting tired of me but could you help me once more?
Thanks!
Last edit: Poep Hoofd 2015-10-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
33 unhappiness. ;))
To exclude the effect of the temporary files, try to repeat all over again. Remove the sources (besides C:\pythonqt\build), unzip PythonQt again, and repeat building.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sadly, when I include it in my Qt project it gives errors upon compiling:
undefined reference to _imp_ZN8PythonQt4selfEv Which I find wierd since I don't have Qt4 but Qt5.
Other errors are: undefined reference to _imp_ZN8PythonQt13getMainModuleEv undefined reference to _imp_ZN17PythonQtObjectPtr8evalFileERK7QString undefined reference to _imp_ZN17PythonQtObjectPtrD1Ev undefined reference to _imp_ZN17PythonQtObjectPtrD1Ev
Last edit: Poep Hoofd 2015-10-05
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am trying to build PythonQt for the past hours and I am failing at it. Consider me a noob at commandline stuff.
When building like it is said on the website, I run qmake.exe which compiles till a certain point where it exits with an error: bigobj not found. I also had an error at rcc.exe not found/prefix incorrect (or some sorts, can't seem to get this error again). I then thought shit, I am compiling with Qt 5.5, so I switched to the qmake.exe of Qt 5.4, since that is the latest version I see mentioned in the changelogs. This build crashes even earlier, stating #include <QtCore QString=""> not found (eventhough I can see QString in QtCore).
I set the paths (using python 2.7) prior to running vcvars32.
I am guessing it is something very obvious I am missing, but I have no clue. Help would be greatly appreciated.
Thanks!
"..bigobj not found.."
Comment out in src/src.pri line
win32: QMAKE_CXXFLAGS + = / bigobj
and you will be happy ;)
Hi, thanks for the quick reply.
Now the build fails at :
'C:\Qt\5.5\mingw492_32\bin\rcc.exe' -name generator generator.qrc -o release/qrc_generator.cpp
The filename, directory name, or volume label syntax is incorrect.
NMAKE: fatal error U1077: ''C:\Qt\5.5\mingw492_32\bin\rcc.exe'' : return code '0x01'
Using Qt 5.5 qmake.exe. If I use Qt 5.4 qmake.exe I get
#include <QtCore/QString> not found
I have no idea why it doesnt see QString nor why it fails at rcc.exe, help would be much appreciated.
Thanks!
Hi!
Try this:
Add to PATH
C:\Qt\5.5\mingw492_32\bin;C:\Qt\Tools\mingw492_32\bin
Add environment variables and reboot:
PYTHON_PATH = c:\Python27
PYTHON_LIB = c:\Python27\libs
Change files:
1) common.prf:
CONFIG += release
2) python.prf:
win32:PYTHON_VERSION=27
unix:PYTHON_VERSION=2.7
win32:LIBS +=$$(PYTHON_LIB)/libpython$${PYTHON_VERSION}$${DEBUG_EXT}.a
3) PythonQt.prf:
win32::LIBS += $$PWD/../lib/libPythonQt$${DEBUG_EXT}.a
4) PythonQt_QtAll.prf:
win32::LIBS += $$PWD/../lib/libPythonQt_QtAll$${DEBUG_EXT}.a
5) src.pri:
Comment out
win32:QMAKE_CXXFLAGS += /bigobj
7) PythonQtScriptingConsole::executeCode:
toLatin1
change totoUtf8
8 ) PythonQt::evalScript
toLatin1
change totoUtf8
9) cd c:\pythonqt
del makefile
qmake
mingw32-make
Good luck!
Last edit: Sergey 2015-09-30
Now I get an error :
c:\Python27\libs/libPython27.a: no such file or directory
Looking at the error I changed Python.prf:
LIBS +=$$(PYTHON_LIB)/libpython$${PYTHON_VERSION}$${DEBUG_EXT}.a
to
LIBS += $$(PYTHON_LIB)/python$${PYTHON_VERSION}$${DEBUG_EXT}.lib
This made it continue until a boatload of errors where thrown like these:
./release/PythonQt.o:PythonQt.cpp:<.text+0x01776>: undefined reference to '_imp__PyInt_Type'
./release/PythonQt.o:PythonQt.cpp:<.text+0x01776>: undefined reference to '_imp__PyType_Type'
./release/PythonQt.o:PythonQt.cpp:<.text+0x01776>: undefined reference to '_imp__PyModule_Type'
Thanks for helping me out here @Sergey :)
Edit: Googling a bit I found:
1. Download the Python source package. Note: Even if you should be using the exact same compiler as the pre-built python package, there's no debug library available in that package and you cannot build the debug library from the pre-built version.
2. Compile Python with the compiler you used for building Qt.
3. Set the PYTHONVERSION and PYTHONPATH variables as described within the PythonQt readme.
4. Compile PythonQt with the same compiler you used to compile Qt and Python.
I downloaded the prebuilt python package (installer), would this be the cause of the problem?
Last edit: Poep Hoofd 2015-09-30
No. I use https://www.python.org/ftp/python/2.7.10/python-2.7.10.msi
Look, there is a file C:\Python27\libs\libpython27.a
Using the .msi I indeed now have the libpython27.a. The build now continues further until it hits this error:
c:\Python27\libs/libpython27.a(dmmes00343.o):<.idata$7+0x0>: undefined reference to '_head_C__build27_cpython_PCBuild_libpython27_a'
Google gave me no useful advice. I tried completely reinstalling python, rebooting, building a freshly extracted pythonQt and fiddling around with the .prf files without succes. I'm sure you are getting tired of me but could you help me once more?
Thanks!
Last edit: Poep Hoofd 2015-10-01
33 unhappiness. ;))
To exclude the effect of the temporary files, try to repeat all over again. Remove the sources (besides C:\pythonqt\build), unzip PythonQt again, and repeat building.
Sadly, did what u said and it still gives the same error. I tried it with Qt 5.4 and it gave the exact same errors. :(
Give me a link to the sources PythonQt, you are trying to build (with makefiles, prf, temporary files, etc.).
https://www.dropbox.com/s/mwifkn4zzvttkgc/myPythonQtBuild.zip?dl=0 This is my folder in a zip after it failed to build with the error above. Many thanks for your efforts!
I am surprised ;) When you build with Python 2.7.10, this error occurs.
Use 2.7.9, and everything will be fine: https://www.python.org/ftp/python/2.7.9/python-2.7.9.msi
I can not explain - ask Florian.
You are a wizard! Thanks a lot for your help! :)
Sadly, when I include it in my Qt project it gives errors upon compiling:
undefined reference to _imp_ZN8PythonQt4selfEv
Which I find wierd since I don't have Qt4 but Qt5.Other errors are:
undefined reference to _imp_ZN8PythonQt13getMainModuleEv
undefined reference to _imp_ZN17PythonQtObjectPtr8evalFileERK7QString
undefined reference to _imp_ZN17PythonQtObjectPtrD1Ev
undefined reference to _imp_ZN17PythonQtObjectPtrD1Ev
Last edit: Poep Hoofd 2015-10-05
Add to the .pro file
cannot find -lpythonqt
cannot find -lpython27
:(
Can't find the libspythonQt folder myself either. Where should it be located?
Yes! Thanks, it runs! :)
U are a wizard