[PyQt] Duplicate symbols building PyQt5 against Qt5.1 on OS X 10.7.5
Hello, I had PyQt5 working with Qt5.0.2 and Python 2.7but decided to dump my Qt5.0.2 and install the new Qt5.1. My environment is mac OS X 10.7.5 which is the latest version of Lion. Qt5.1 installed without issues. SIP installed without issues. Running python configure.py for PyQt-gpl-5.0 failed with an error, Error: Unable to create the C++ code. The sources were in a folder on my desktop as they were last time I installed PyQt5 against Qt5.0.2 albeit without this error. I Googled and found that spaces in a path have caused this error in the past and by moving the PyQt source directory to my user directory solved this issue and I was then able to run python configure.py without further errors or warnings. I ran make clean and then ran make . I had a few warnings that various Qt directories could not be found similar to warning: directory not found for option '-F/Users/chris/Qt//5.1.0/clang_64/qttools/lib' it turns out this is a known bug with qmake, QTBUG-28336, that hadn't shown up until more modularization of Qt for Qt5.1. But long after the warnings and it was starting to look like it was getting close to finishing I got a list of eight duplicate symbols and the following error. ld: 8 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [pylupdate5] Error 1 make: *** [sub-pylupdate-make_first-ordered] Error 2 I was able to find a work around for the warnings by creating symlinks to the actual directories. Doing this though did not solve the duplicate symbols problem. Running make clean and make --silent results in the following, Makefile:1481: warning: overriding commands for target `moc_translator.o' Makefile:989: warning: ignoring old commands for target `moc_translator.o' duplicate symbol __ZN10Translator18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv in: moc_translator.o duplicate symbol __ZNK10Translator10metaObjectEv in: moc_translator.o duplicate symbol __ZN10Translator16staticMetaObjectE in: moc_translator.o duplicate symbol __ZN10Translator11qt_metacastEPKc in: moc_translator.o duplicate symbol __ZN10Translator11qt_metacallEN11QMetaObject4CallEiPPv in: moc_translator.o duplicate symbol __ZTV10Translator in: moc_translator.o duplicate symbol __ZTI10Translator in: moc_translator.o duplicate symbol __ZTS10Translator in: moc_translator.o ld: 8 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [pylupdate5] Error 1 make: *** [sub-pylupdate-make_first-ordered] Error 2 So there were two warnings that were probably there prior and I missed them among all the echoed commands and are clearly connected with the duplicate symbols. What I have not been able to figure out though is exactly why this is happing and how to fix it. I have not manually edited any of the PyQt files and I would think make clean should have taken care of duplicates from my prior install of PyQt5 left over in the sources directory. I'm hoping that someone with more knowledge and experience can point me in the right direction for solving this. Thank you kindly, ~Chris ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] Accessing a toggle button without clicking on it
Thank you for reading this. How to I access my toggle button slot without clicking on the button? For example: if hr == 19: # this button is accessible self. on_pushButton_clicked() # this fails because checked is not defined self.on_ledButton_toggled(checked) Slots @pyqtSignature() def on_pushButton_clicked(self): @pyqtSignature(bool) def on_ledButton_toggled(self, checked): -- Regards, Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] ANN: eric 4.5.13 released
Hi, I just uploaded eric 4.5.13. It is a maintenance release fixing some bugs. It is available via the eric web site. http://eric-ide.python-projects.org/index.html Regards, Detlev -- Detlev Offenbach det...@die-offenbachs.de ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] ANN: eric 5.3.5 released
Hi, I just uploaded eric 5.3.5. It is a maintenance release fixing some bugs. It is available via the eric web site. http://eric-ide.python-projects.org/index.html Regards, Detlev -- *Detlev Offenbach* det...@die-offenbachs.de ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] [SIP] Segfault with nested template types
After lost of frustrations I seem to find the correct solution: use #define sipType_cell sipFindType(QPairint, int) instead of #define sipType_cell sipFindType(cell) Hope it helps anyone with similar problems in future. On Sat, Jul 06, 2013 at 02:04:57AM +0800, Casper Ti. Vector wrote: test.h: #include qmap.h #include qpair.h typedef QPairint, int cell; struct test { QMapcell, cell pia; }; extern test Test; void pia_test(); test.cpp: #include test.h using namespace std; test Test; void pia_test() { Test.pia[QPairint, int(0, 0)] = QPairint, int(0, 0); } test.sip: %Module test %ModuleHeaderCode #include test.h #define sipType_cell sipFindType(cell) %End %Include qmap.sip // Exactly same file from PyQt4 %Include qpair.sip// See above typedef QPairint, int cell; struct test { QMapcell, cell pia; }; test Test; void pia_test(); test.py: import test print(test.Test.pia) # An empty dictionary test.pia_test() print(test.Test.pia) # Causes a segmentation fault How can I resolve this kind of issues? Is this some kind of bug? Thanks very much :) -- My current OpenPGP key: 4096R/0xE18262B5D9BF213A (expires: 2017.1.1) D69C 1828 2BF2 755D C383 D7B2 E182 62B5 D9BF 213A ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] make error in PyQt4 install
Hi, Installing the last PyQt4 PyQt-x11-gpl-4.10.2, the make fail with this error: ... rm -f libqpydbus.a ar cqs libqpydbus.a qpydbus_chimera_helpers.o qpydbus_post_init.o qpydbuspendingreply.o qpydbusreply.o make[2]: quittant le répertoire « /home/vincent/Téléchargements/PyQt-x11-gpl-4.10.2/qpy/QtDBus » make[1]: quittant le répertoire « /home/vincent/Téléchargements/PyQt-x11-gpl-4.10.2/qpy » cd QtCore/ make -f Makefile make[1]: entrant dans le répertoire « /home/vincent/Téléchargements/PyQt-x11-gpl-4.10.2/QtCore » g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_WEBKIT -DSIP_PROTECTED_IS_PUBLIC -Dprotected=public -DQT_NO_DEBUG -DQT_PLUGIN -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I/usr/include/python2.7 -I../qpy/QtCore -I. -o sipQtCoreQTimerEvent.o sipQtCoreQTimerEvent.cpp /home/vincent/Téléchargements/PyQt-x11-gpl-4.10.2/QtCore/sipQtCoreQTimerEvent.cpp:242:1: erreur: too many initializers for ‘sipClassTypeDef {aka _sipClassTypeDef}’ make[1]: *** [sipQtCoreQTimerEvent.o] Erreur 1 make[1]: quittant le répertoire « /home/vincent/Téléchargements/PyQt-x11-gpl-4.10.2/QtCore » make: *** [sub-QtCore-make_default-ordered] Erreur 2 Regards ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] [SIP] is there a Qt5 example for SIP?
On Sat, 6 Jul 2013 07:30:43 -0700, br...@stottlemyer.com wrote: Hi Phil, I am trying to see if SIP will help me with a task I'm trying to solve. I started out by trying the More Complex C++ Example in the docs. However, I'm using Qt5, and the example is for Qt4. I see the pyqtconfig is part of Qt4, but not Qt5. No problem, except pyqtconfig is pretty integrated into the example, and as a beginner, I'm not sure how to take pyqtconfig out. Is there a Qt5 example for SIP? Look at the configure.py for PyQt5. A minimal build system would just be a shell script that invoked sip then the C++ compiler then the linker. The only thing you need to consider is to use the right -t flags to sip and these can be found by introspecting current versions of PyQt. Phil Thanks for the pointers. I've got the example working. But now I'm having trouble extending the example. I've got a bunch of enums I need to make available, some of which have overlapping names. I've been handling this by putting them in different namespaces. But sip is complaining about that. I saw an old mailing list question on the topic (http://www.riverbankcomputing.com/pipermail/pyqt/2007-August/016847.html), but no solution was posted. My .h file is: // Define the interface to the hello library. #include qlabel.h #include qwidget.h #include qstring.h #if defined HELLO_DLL # define HELLO_DLLSPEC Q_DECL_EXPORT #else # define HELLO_DLLSPEC Q_DECL_IMPORT #endif namespace MyNamespace { enum MyEnum { No=0, Yes=1}; }; class HELLO_DLLSPEC Hello : public QLabel { // This is needed by the Qt Meta-Object Compiler. Q_OBJECT public: Hello(QWidget *parent = 0); private: // Prevent instances from being copied. Hello(const Hello ); Hello operator=(const Hello ); }; #if !defined(Q_OS_WIN) void setDefault(const QString def); #endif My .sip file is: // Define the SIP wrapper to the hello library. %Module hello %Import QtGui/QtGuimod.sip %Import QtWidgets/QtWidgetsmod.sip %If (Qt_5_0_0 -) namespace MyNamespace { %TypeHeaderCode #include hello.h %End enum MyEnum { No=0, Yes=1}; }; class Hello : public QLabel { %TypeHeaderCode #include hello.h %End public: Hello(QWidget *parent /TransferThis/ = 0); private: Hello(const Hello ); }; %If (!WS_WIN) void setDefault(const QString def); %End %End The compiler (linker, actually) is complaining about missing symbols: Creating library release\hello.lib and object release\hello.exp siphellocmodule.obj : error LNK2001: unresolved external symbol struct _pyqt4ClassTypeDef sipTypeDef_hello_MyNamespace (?sipTypeDef_hello_MyNamespace@@3U_pyqt4ClassTypeDef@@A) release\hello.dll : fatal error LNK1120: 1 unresolved externals What's the proper way to describe this to sip? Thanks! ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Issue with PyQt4/5 and Qt 5.1
On Sat, 06 Jul 2013 15:42:21 +0200, Detlev Offenbach det...@die-offenbachs.de wrote: Hello, today I compiled the Qt 5.1 and built the latest stable releases of PyQt4 and PyQt5 against it. Now I am not able to start any QProcess. I executed the QProcess test program as contained in 'qtbase/tests/auto/corelib/io/qprocess'. This shows a complete success. However, if I execute the demo 'PyQt-gpl-5.0/examples/qtdemo', it doesn't work (starting assistant or any of the examples fail). What did I do wrong? The behavior is identical with PyQt4 and PyQt5. It's a Qt bug - they've broken compatibility. There will be a workaround in tonight's snapshots. Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Duplicate symbols building PyQt5 against Qt5.1 on OS X 10.7.5
On Sun, 7 Jul 2013 00:13:24 -0700, Chris Knight ch...@dsl-only.net wrote: Hello, I had PyQt5 working with Qt5.0.2 and Python 2.7but decided to dump my Qt5.0.2 and install the new Qt5.1. My environment is mac OS X 10.7.5 which is the latest version of Lion. Qt5.1 installed without issues. SIP installed without issues. Running python configure.py for PyQt-gpl-5.0 failed with an error, Error: Unable to create the C++ code. The sources were in a folder on my desktop as they were last time I installed PyQt5 against Qt5.0.2 albeit without this error. I Googled and found that spaces in a path have caused this error in the past and by moving the PyQt source directory to my user directory solved this issue and I was then able to run python configure.py without further errors or warnings. I ran make clean and then ran make . I had a few warnings that various Qt directories could not be found similar to warning: directory not found for option '-F/Users/chris/Qt//5.1.0/clang_64/qttools/lib' it turns out this is a known bug with qmake, QTBUG-28336, that hadn't shown up until more modularization of Qt for Qt5.1. But long after the warnings and it was starting to look like it was getting close to finishing I got a list of eight duplicate symbols and the following error. ld: 8 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [pylupdate5] Error 1 make: *** [sub-pylupdate-make_first-ordered] Error 2 I was able to find a work around for the warnings by creating symlinks to the actual directories. Doing this though did not solve the duplicate symbols problem. Running make clean and make --silent results in the following, Makefile:1481: warning: overriding commands for target `moc_translator.o' Makefile:989: warning: ignoring old commands for target `moc_translator.o' duplicate symbol __ZN10Translator18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv in: moc_translator.o duplicate symbol __ZNK10Translator10metaObjectEv in: moc_translator.o duplicate symbol __ZN10Translator16staticMetaObjectE in: moc_translator.o duplicate symbol __ZN10Translator11qt_metacastEPKc in: moc_translator.o duplicate symbol __ZN10Translator11qt_metacallEN11QMetaObject4CallEiPPv in: moc_translator.o duplicate symbol __ZTV10Translator in: moc_translator.o duplicate symbol __ZTI10Translator in: moc_translator.o duplicate symbol __ZTS10Translator in: moc_translator.o ld: 8 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [pylupdate5] Error 1 make: *** [sub-pylupdate-make_first-ordered] Error 2 So there were two warnings that were probably there prior and I missed them among all the echoed commands and are clearly connected with the duplicate symbols. What I have not been able to figure out though is exactly why this is happing and how to fix it. I have not manually edited any of the PyQt files and I would think make clean should have taken care of duplicates from my prior install of PyQt5 left over in the sources directory. I'm hoping that someone with more knowledge and experience can point me in the right direction for solving this. Thank you kindly, ~Chris I can't reproduce this (at least with 10.8.4). I can only suggest you make sure you have a clean source tree. Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] make error in PyQt4 install
On Sun, 07 Jul 2013 12:26:18 +0200, Vincent Vande Vyvre vincent.vandevy...@swing.be wrote: Hi, Installing the last PyQt4 PyQt-x11-gpl-4.10.2, the make fail with this error: ... rm -f libqpydbus.a ar cqs libqpydbus.a qpydbus_chimera_helpers.o qpydbus_post_init.o qpydbuspendingreply.o qpydbusreply.o make[2]: quittant le répertoire « /home/vincent/Téléchargements/PyQt-x11-gpl-4.10.2/qpy/QtDBus » make[1]: quittant le répertoire « /home/vincent/Téléchargements/PyQt-x11-gpl-4.10.2/qpy » cd QtCore/ make -f Makefile make[1]: entrant dans le répertoire « /home/vincent/Téléchargements/PyQt-x11-gpl-4.10.2/QtCore » g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_WEBKIT -DSIP_PROTECTED_IS_PUBLIC -Dprotected=public -DQT_NO_DEBUG -DQT_PLUGIN -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I/usr/include/python2.7 -I../qpy/QtCore -I. -o sipQtCoreQTimerEvent.o sipQtCoreQTimerEvent.cpp /home/vincent/Téléchargements/PyQt-x11-gpl-4.10.2/QtCore/sipQtCoreQTimerEvent.cpp:242:1: erreur: too many initializers for ‘sipClassTypeDef {aka _sipClassTypeDef}’ make[1]: *** [sipQtCoreQTimerEvent.o] Erreur 1 make[1]: quittant le répertoire « /home/vincent/Téléchargements/PyQt-x11-gpl-4.10.2/QtCore » make: *** [sub-QtCore-make_default-ordered] Erreur 2 Some more information would be useful. As nobody else has complained I'd suggest it is a problem with your installation/configuration. Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] make error in PyQt4 install
Le 07/07/2013 19:15, Phil Thompson a écrit : Some more information would be useful. As nobody else has complained I'd suggest it is a problem with your installation/configuration. Phil This is on Ubuntu 10.4 where I've installed PyQt5-5.0 with sip-4.14.7 I can't install the official .deb package because the package system dont see sip (not installed by him) and want to force a new install of sip. But I think I can solve this, I don't need PyQt4 with Python3 nor PyQt5 with Python2. Thanks. -- Vincent V.V. Oqapy https://launchpad.net/oqapy . Qarte https://launchpad.net/qarte . PaQager https://launchpad.net/paqager ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] PyQt5 Snapshot, build problems and their solutions, Windows, mingw
On 07.07.2013, 15:13:15 Phil Thompson wrote: On Sun, 12 May 2013 22:42:23 +0200, mathias.b...@gmx.de wrote: Hi, I've compiled the latest PyQt5 snaphot, on 32bit python 3.3.1 (compiled with mingw, using a self-made build script based on scons), Windows7, Qt 5.1alpha. I've used this configuration step: D:\_cpp_projects_\Python\Python-3.3.1\.build_release\python.exe configure.py --no-docstrings --confirm-license -u --spec=win32-g++ --verbose --trace --sip=D:\_cpp_projects_\Python\Python-3.3.1\sip.exe LFLAGS+=-LD:\_cpp_projects_\Python\Python-3.3.1\.build_debug -LD:\_cpp_projects_\Python\Python-3.3.1\.build_release DEFINES+=_DEBUG (It's necessary to include the release version of the python lib even in debug build for the designer plugins.) I've run into a number of problems: (1) PyQt's configure.py autoamtically assumes certain MS-compilers on the win32 platform, in TargetConfiguration.__init__():262 and following: # The default qmake spec. if sys.platform == 'win32': if self.py_version = 0x030300: #self.qmake_spec = 'win32-msvc2010' self.qmake_spec = 'win32-g++' elif self.py_version = 0x020600: self.qmake_spec = 'win32-msvc2008' elif self.py_version = 0x020400: self.qmake_spec = 'win32-msvc.net' else: self.qmake_spec = 'win32-msvc' else: # Use the Qt default. (We may update it for MacOS/X later.) self.qmake_spec = '' I had to make the marked change to get around that for my mingw-based python. It would be nice if there was an option to influence that. I don't understand why this is needed. Using the --spec option should do that. [Motivation: I must embedd the python interpreter, and I want to get away from MS Visual Studio, because it is becoming slower with each version. Hence I'll have to compile python myself using mingw, which is non-standard.] (2) All makefiles attempt to build all DLLs without referring to the python DLL. Adding -lpython33_d to each Makefile.Debug and -lpython33 to Makefile.Release solves this. I tried adding LFLAGS_DEBUG+=-lpython33_d as parameter to the configure script, but it had no effect on the makefiles. (3) The final debugging versions of the DLLs get the wrong names. They all miss the trailing _d. This way they can't be imported, unless manually renamed arcordingly. Try tonight's snapshot. Thanks. Using VS2012, it now works out of the box with python 3.3.2 and Qt 5.1. Have not tested the mingw stuff yet. Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] [SIP] is there a Qt5 example for SIP?
On 07.07.2013, 13:46:02 br...@stottlemyer.com wrote: On Sat, 6 Jul 2013 07:30:43 -0700, br...@stottlemyer.com wrote: Hi Phil, I am trying to see if SIP will help me with a task I'm trying to solve. I started out by trying the More Complex C++ Example in the docs. However, I'm using Qt5, and the example is for Qt4. I see the pyqtconfig is part of Qt4, but not Qt5. No problem, except pyqtconfig is pretty integrated into the example, and as a beginner, I'm not sure how to take pyqtconfig out. Is there a Qt5 example for SIP? Look at the configure.py for PyQt5. A minimal build system would just be a shell script that invoked sip then the C++ compiler then the linker. The only thing you need to consider is to use the right -t flags to sip and these can be found by introspecting current versions of PyQt. Phil Thanks for the pointers. I've got the example working. But now I'm having trouble extending the example. I've got a bunch of enums I need to make available, some of which have overlapping names. I've been handling this by putting them in different namespaces. But sip is complaining about that. I saw an old mailing list question on the topic (http://www.riverbankcomputing.com/pipermail/pyqt/2007-August/016847.html), but no solution was posted. My .h file is: // Define the interface to the hello library. #include qlabel.h #include qwidget.h #include qstring.h #if defined HELLO_DLL # define HELLO_DLLSPEC Q_DECL_EXPORT #else # define HELLO_DLLSPEC Q_DECL_IMPORT #endif namespace MyNamespace { enum MyEnum { No=0, Yes=1}; }; class HELLO_DLLSPEC Hello : public QLabel { // This is needed by the Qt Meta-Object Compiler. Q_OBJECT public: Hello(QWidget *parent = 0); private: // Prevent instances from being copied. Hello(const Hello ); Hello operator=(const Hello ); }; #if !defined(Q_OS_WIN) void setDefault(const QString def); #endif My .sip file is: // Define the SIP wrapper to the hello library. %Module hello %Import QtGui/QtGuimod.sip %Import QtWidgets/QtWidgetsmod.sip %If (Qt_5_0_0 -) namespace MyNamespace { %TypeHeaderCode #include hello.h %End enum MyEnum { No=0, Yes=1}; }; class Hello : public QLabel { %TypeHeaderCode #include hello.h %End public: Hello(QWidget *parent /TransferThis/ = 0); private: Hello(const Hello ); }; %If (!WS_WIN) void setDefault(const QString def); %End %End The compiler (linker, actually) is complaining about missing symbols: Creating library release\hello.lib and object release\hello.exp siphellocmodule.obj : error LNK2001: unresolved external symbol struct _pyqt4ClassTypeDef sipTypeDef_hello_MyNamespace (?sipTypeDef_hello_MyNamespace@@3U_pyqt4ClassTypeDef@@A) release\hello.dll : fatal error LNK1120: 1 unresolved externals What's the proper way to describe this to sip? Hi, Are you really compiling and linking all C++ files generated by SIP? Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] [SIP] is there a Qt5 example for SIP?
... Hi, Are you really compiling and linking all C++ files generated by SIP? D'oh! No I wasn't. Thanks for pointing me in the right direction (and ending the trail of random stuff I was trying). ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt