Please help. On Debian developer computer I have cross-compilation environment to build for Angstrom linux targets. So, I download PythonQt sources, make copy of Angstrom's Python2.6.6 include and lib directories to Debian, modify python.prf targeting to those dirs. While build raised an errors.
In file included from ../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp:1:
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.h:1130: error: expected class-name before '{' token
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.h: In constructor 'PythonQtShell_QAccessible::PythonQtShell_QAccessible()':
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.h:1132: error: class 'PythonQtShell_QAccessible' does not have any field named 'QAccessible'
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.h: At global scope:
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.h:1144: error: 'QAccessible' has not been declared
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.h:1144: error: 'QAccessible' has not been declared
...
And so one
PythonQt_QtAll.so wasn't created, but libPythonQt.so appears.
Lucky I copy libPythonQt.so to Angstrom and check simple application with evalScript("19*2+4", Py_eval_input) - it dose successfully return 42! But evalFile("GettingStarted.py") doesn't produce any output (GettingStarted.pyc generated in current dir). Content of my GettingStarted.py is just "print 'Hello world' ".
And in python console I try execute "from libPythonQt import *" it answer:
from libPythonQt import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dynamic module does not define init function (initPythonQt)
Last edit: Anton 2015-03-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can not import PythonQt from within a normal Python environment. It can only be embedded into your C++ application. Probably the GettingStarted links against PythonQt_QtAll, so you can not run that.
Try to get the complete build working, have a look at the compile errors.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks, Florian. Take a look on errors.. Something missed. Some ideas?
In file included from ../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp:1:
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.h:1130: error: expected class-name before '{' token
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.h: In constructor 'PythonQtShell_QAccessible::PythonQtShell_QAccessible()':
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.h:1132: error: class 'PythonQtShell_QAccessible' does not have any field named 'QAccessible'
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.h: At global scope:
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.h:1144: error: 'QAccessible' has not been declared
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.h:1144: error: 'QAccessible' has not been declared
...
And so one
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Probably your platform does not support QAccessible, but PythonQt_QtAll contains wrappers for QAccessible (since they are available on Windows/Mac/Linux by default).
You can edit the .xml files in the generator directory and remove all QAccessible classes. Then you need to build and run the pythonqt_generator to create the new wrappers.
Alternatively you can run the pythonqt_generator against the Qt header files of the Angstrom linux, but I have no idea where those are located on you system. You can set QTDIR to point to that directory and the generator will use those header files.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Has no effect. Just comment any tags that have "QAccessible" in xml files (typesystem_gui.xml, typesystem_gui-common.xml, typesystem_gui-qtscript.xml), remove existent pythonqt_generator and start build again. Error raised same as before(
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The build script does NOT run the pythonqt_generator. You need to run it by yourself and it should generated a generated_cpp directory. Afterwards you need to re-run QMake on the project files and rebuild.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
On Angstrom installed Qt4.7.2(3) libs, and I decide to compile PythonQt2.1_Qt4.6.2 sources using Qt4.7.3 headers. Copied generator folder to Angstrom, run python_generator, successfully make generated_cpp folder. Transfer generated_cpp back again to local machine and re-run qmake. Some errors appear, my mention it because of Qt4.7.2 libs and PythonQt--4.6.2 versions incompatibility. Last chance is to try PythonQt2.1_Qt4.8.zip or may be Qt4.6.2 headers. Am I right?
Errors was:
/home/arago-2011.09/armv7a/arm-none-linux-gnueabi/usr/include/qt4 -I../../src -I. -o com_trolltech_qt_gui0.o ../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp: In member function 'virtual void PythonQtShell_QApplication::commitData(QSessionManager&)':
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp:11450: error: 'commitData' is not a member of 'QApplication'
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp: In member function 'virtual void PythonQtShell_QApplication::saveState(QSessionManager&)':
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp:11568: error: 'saveState' is not a member of 'QApplication'
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp: In member function 'bool PythonQtWrapper_QApplication::isSessionRestored(QApplication) const':
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp:11704: error: 'class QApplication' has no member named 'isSessionRestored'
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp: In member function 'QString PythonQtWrapper_QApplication::sessionId(QApplication) const':
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp:11769: error: 'class QApplication' has no member named 'sessionId'
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp: In member function 'QString PythonQtWrapper_QApplication::sessionKey(QApplication) const':
../../generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp:11774: error: 'class QApplication' has no member named 'sessionKey'
make[2]: ** [com_trolltech_qt_gui0.o] Error 1
Last edit: Anton 2015-03-05
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please help. On Debian developer computer I have cross-compilation environment to build for Angstrom linux targets. So, I download PythonQt sources, make copy of Angstrom's Python2.6.6 include and lib directories to Debian, modify python.prf targeting to those dirs. While build raised an errors.
PythonQt_QtAll.so wasn't created, but libPythonQt.so appears.
Lucky I copy libPythonQt.so to Angstrom and check simple application with evalScript("19*2+4", Py_eval_input) - it dose successfully return 42! But evalFile("GettingStarted.py") doesn't produce any output (GettingStarted.pyc generated in current dir). Content of my GettingStarted.py is just "print 'Hello world' ".
And in python console I try execute "from libPythonQt import *" it answer:
Last edit: Anton 2015-03-04
You can not import PythonQt from within a normal Python environment. It can only be embedded into your C++ application. Probably the GettingStarted links against PythonQt_QtAll, so you can not run that.
Try to get the complete build working, have a look at the compile errors.
Thanks, Florian. Take a look on errors.. Something missed. Some ideas?
Probably your platform does not support QAccessible, but PythonQt_QtAll contains wrappers for QAccessible (since they are available on Windows/Mac/Linux by default).
You can edit the .xml files in the generator directory and remove all QAccessible classes. Then you need to build and run the pythonqt_generator to create the new wrappers.
Alternatively you can run the pythonqt_generator against the Qt header files of the Angstrom linux, but I have no idea where those are located on you system. You can set QTDIR to point to that directory and the generator will use those header files.
Has no effect. Just comment any tags that have "QAccessible" in xml files (typesystem_gui.xml, typesystem_gui-common.xml, typesystem_gui-qtscript.xml), remove existent pythonqt_generator and start build again. Error raised same as before(
The build script does NOT run the pythonqt_generator. You need to run it by yourself and it should generated a generated_cpp directory. Afterwards you need to re-run QMake on the project files and rebuild.
As I understand, I should copy entire "generator" folder to Angstrom and run pythonqt_generator here, and I need Angstrom Qt headers also for that?
Only if you don't change the xmls, if you remove the QAccessibility classes from the XML,
you can run it on your local machine.
On Angstrom installed Qt4.7.2(3) libs, and I decide to compile PythonQt2.1_Qt4.6.2 sources using Qt4.7.3 headers. Copied generator folder to Angstrom, run python_generator, successfully make generated_cpp folder. Transfer generated_cpp back again to local machine and re-run qmake. Some errors appear, my mention it because of Qt4.7.2 libs and PythonQt--4.6.2 versions incompatibility. Last chance is to try PythonQt2.1_Qt4.8.zip or may be Qt4.6.2 headers. Am I right?
Errors was:
Last edit: Anton 2015-03-05