LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-11-2015, 08:01 AM   #1
rrrssssss
Member
 
Registered: Mar 2005
Posts: 288

Rep: Reputation: 34
Compilling pyqt3 on Kubuntu Trusty error


Hello forum,

I am trying to compile pyqt3 (18v3.18.15 tarball) in Kubuntu 14.4 (Trusty) but I keep getting an error message shown below:

Code:
sip/qt/qimage.sip: In function ‘const char** PyQt_qt_ListToArray(PyObject*)’:
sip/qt/qimage.sip:535:13: error: ‘ANY’ was not declared in this scope
sip/qt/qimage.sip:535:18: error: expected primary-expression before ‘)’ token
sip/qt/qobject.sip: At global scope:
sip/qt/qobject.sip:1256:1: warning: missing initializer for member ‘_heaptypeobject::as_number’ [-Wmissing-field-initializers]
sip/qt/qobject.sip:1256:1: warning: missing initializer for member ‘_heaptypeobject::as_mapping’ [-Wmissing-field-initializers]
sip/qt/qobject.sip:1256:1: warning: missing initializer for member ‘_heaptypeobject::as_sequence’ [-Wmissing-field-initializers]
sip/qt/qobject.sip:1256:1: warning: missing initializer for member ‘_heaptypeobject::as_buffer’ [-Wmissing-field-initializers]
sip/qt/qobject.sip:1256:1: warning: missing initializer for member ‘_heaptypeobject::ht_name’ [-Wmissing-field-initializers]
sip/qt/qobject.sip:1256:1: warning: missing initializer for member ‘_heaptypeobject::ht_slots’ [-Wmissing-field-initializers]
qt/sipqtcmodule.cpp:12287:1: warning: narrowing conversion of ‘PYQT_VERSION’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
make[1]: *** [sipqtcmodule.o] Error 1
make[1]: Leaving directory `/home/roy/Downloads/PPyQt-x11-gpl-3.18.1/qt'
make: *** [all] Error 2
I already have QT3 (v 3.3.8b) installed and I have tried several versions of SIP. And I have tried several versions of python (2.6 and 2.7) but I keep getting the same error message regardless of which version I use, so it makes me believe my problem is not a version mis-match. Kubuntu uses pyqt4 and qt4 which are not what I need.

The reason I am trying to install these older programs is because I have an old app called hdpvrassistant that was written with these older programs about 4 years ago. Hdpvrassistant will not compile with the version of Kubuntu I presently have using APT. The Kubuntu package manager does not have these older programs such as qt3, pyqt3, sip in their repositories so that is why I'm using tarballs of older versions.

It may be important to note that I had to add "#include <stddef.h and #include <stdlib.h>" to every .cpp file while compiling QT3 since Kubuntu has a newer version of libc than what the programs were written for but adding these two entries to pyqt3 does not prevent the error above. They worked for qt3 but not for pyqt3.

So it seems to me I may need to add other entries similar to "#include <stddef.h and #include <stdlib.h>" to pyqt3 to get it to compile but I do not know which entries to add other than the two I already tried.

Would it help if I used a lower version of gcc perhaps?

I am hoping some of you can lead and guide me or give me a hint as to what to do to get pyqt3 to compile.

Thanks abundently,
Roy

Last edited by rrrssssss; 02-11-2015 at 03:38 PM.
 
Old 02-11-2015, 11:09 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Since you are compiling old pyqt3 which won't be knowing about latest gcc supported C++11 which gcc is defaulting so it produces error.
You may have to run g++ with options -std=c++98 or -std=c++03. Usually we set CXXFLAGS environment varaible while running ./configure.
I don't know how pyqt3 is configure or built. If you give build steps details it may help.

Also setting -Wno-narrowing -Wno-missing-field-initializers to CXXFLAGS or passing it to g++ may help, because they are causing that error.
 
Old 02-11-2015, 03:24 PM   #3
rrrssssss
Member
 
Registered: Mar 2005
Posts: 288

Original Poster
Rep: Reputation: 34
Hello Veerain,

Thanks for taking an interest in my problem.

The way I install pyqt3 is to run "configure.py" instead of "configure, since there is no "configure", using the line below, while in the pyqt3 directory:

Code:
/usr/local/bin/python2.6 configure.py -w
The "w" switch is for debugging info.

The code below consists of the resuslts of running "configure.py" and below it is the results of running "make". I ommited much of the depreciation warning to keep the file from being too long. Running "configure.py" invokes my version of python also, as you can see on the first line.

Code:
roy@roy-kubuntu:~/Downloads/PyQt-x11-gpl-3.18.1$ /usr/local/bin/python2.6 configure.py -w
This is the GPL version of PyQt 3.18.1 (licensed under the GNU General Public
License) for Python 2.6.9 on linux3.

Type 'L' to view the license.
Type 'yes' to accept the terms of the license.
Type 'no' to decline the terms of the license.

Do you accept the terms of the license? yes
qextscintillaglobal.h could not be found in /usr/local/qt/include and so the
qtext module will not be built. If QScintilla is installed then use the -n
argument to explicitly specify the correct directory.
Checking to see if the qtcanvas module should be built...
Checking to see if the qtnetwork module should be built...
Checking to see if the qttable module should be built...
Checking to see if the qtxml module should be built...
Checking to see if the qtgl module should be built...
/usr/bin/ld: cannot find -lXmu
collect2: error: ld returned 1 exit status
Checking to see if the qtui module should be built...
Checking to see if the qtsql module should be built...
Checking to see if the QAssistantClient class is available...
Creating features file...
Checking to see if the QCDEStyle class is built in...
cfgtest.cpp: In function ‘int main(int, char**)’:
cfgtest.cpp:5:9: error: expected type-specifier before ‘QCDEStyle’
     new QCDEStyle();
         ^
cfgtest.cpp:5:9: error: expected ‘;’ before ‘QCDEStyle’
Checking to see if the QInterlaceStyle class is built in...
cfgtest.cpp: In function ‘int main(int, char**)’:
cfgtest.cpp:5:9: error: expected type-specifier before ‘QInterlaceStyle’
     new QInterlaceStyle();
         ^
cfgtest.cpp:5:9: error: expected ‘;’ before ‘QInterlaceStyle’
Checking to see if the QMotifStyle class is built in...
cfgtest.cpp: In function ‘int main(int, char**)’:
cfgtest.cpp:5:9: error: expected type-specifier before ‘QMotifStyle’
     new QMotifStyle();
         ^
cfgtest.cpp:5:9: error: expected ‘;’ before ‘QMotifStyle’
Checking to see if the QMotifPlusStyle class is built in...
cfgtest.cpp: In function ‘int main(int, char**)’:
cfgtest.cpp:5:9: error: expected type-specifier before ‘QMotifPlusStyle’
     new QMotifPlusStyle();
         ^
cfgtest.cpp:5:9: error: expected ‘;’ before ‘QMotifPlusStyle’
Checking to see if the QPlatinumStyle class is built in...
cfgtest.cpp: In function ‘int main(int, char**)’:
cfgtest.cpp:5:9: error: expected type-specifier before ‘QPlatinumStyle’
     new QPlatinumStyle();
         ^
cfgtest.cpp:5:9: error: expected ‘;’ before ‘QPlatinumStyle’
Checking to see if the QSGIStyle class is built in...
cfgtest.cpp: In function ‘int main(int, char**)’:
cfgtest.cpp:5:9: error: expected type-specifier before ‘QSGIStyle’
     new QSGIStyle();
         ^
cfgtest.cpp:5:9: error: expected ‘;’ before ‘QSGIStyle’
Checking to see if the QWindowsStyle class is built in...
Qt v3.3.8 free edition is being used.
SIP 4.14.7 is being used.
These PyQt modules will be built: qt qtcanvas qtnetwork qttable qtxml qtui
qtsql.
Support for these Qt classes has been disabled: QCDEStyle QInterlaceStyle
QMotifStyle QMotifPlusStyle QPlatinumStyle QSGIStyle.
The PyQt modules will be installed in /usr/local/lib/python2.6/site-packages.
The PyQt .sip files will be installed in /usr/local/share/sip.
The Qt header files are in /usr/local/qt/include.
The qt Qt library is in /usr/local/qt/lib.
pyuic will be installed in /usr/local/bin.
pylupdate will be installed in /usr/local/bin.
Generating the C++ source for the qt module...
sip: Deprecation warning: sip/qt/qtmod.sip:23: %Module version number should be specified using the 'version' argument
sip: Deprecation warning: sip/qt/copying.sip:45: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/qt/copying.sip:46: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/pyqt-gpl.sip:1: %License annotations are deprecated, use arguments instead
sip: Deprecation warning: sip/qt/copying.sip:47: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead

Creating the Makefile for the qt module...
Generating the C++ source for the qtui module...
sip: Deprecation warning: sip/qtui/qtuimod.sip:24: %Module version number should be specified using the 'version' argument
sip: Deprecation warning: sip/qt/qtmod.sip:23: %Module version number should be specified using the 'version' argument
sip: Deprecation warning: sip/qt/copying.sip:45: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/qt/copying.sip:46: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/pyqt-gpl.sip:1: %License annotations are deprecated, use arguments instead
sip: Deprecation warning: sip/qt/copying.sip:47: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead

Creating the Makefile for the qtui module...
Generating the C++ source for the qtcanvas module...
sip: Deprecation warning: sip/qtcanvas/qtcanvasmod.sip:23: %Module version number should be specified using the 'version' argument
sip: Deprecation warning: sip/qt/qtmod.sip:23: %Module version number should be specified using the 'version' argument
sip: Deprecation warning: sip/qt/copying.sip:45: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/qt/copying.sip:46: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/pyqt-gpl.sip:1: %License annotations are deprecated, use arguments instead
sip: Deprecation warning: sip/qt/copying.sip:47: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead

Creating the Makefile for the qtcanvas module...
Generating the C++ source for the qtnetwork module...
sip: Deprecation warning: sip/qtnetwork/qtnetworkmod.sip:23: %Module version number should be specified using the 'version' argument
sip: Deprecation warning: sip/qt/qtmod.sip:23: %Module version number should be specified using the 'version' argument
sip: Deprecation warning: sip/qt/copying.sip:45: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/qt/copying.sip:46: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/pyqt-gpl.sip:1: %License annotations are deprecated, use arguments instead
sip: Deprecation warning: sip/qt/copying.sip:47: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead

Creating the Makefile for the qtnetwork module...
Generating the C++ source for the qtsql module...
sip: Deprecation warning: sip/qtsql/qtsqlmod.sip:23: %Module version number should be specified using the 'version' argument
sip: Deprecation warning: sip/qt/qtmod.sip:23: %Module version number should be specified using the 'version' argument
sip: Deprecation warning: sip/qt/copying.sip:45: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/qt/copying.sip:46: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/pyqt-gpl.sip:1: %License annotations are deprecated, use arguments instead
sip: Deprecation warning: sip/qt/copying.sip:47: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/qt/copying.sip:48: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/qt/copying.sip:49: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead

Creating the Makefile for the qtsql module...
Generating the C++ source for the qttable module...
sip: Deprecation warning: sip/qttable/qttablemod.sip:23: %Module version number should be specified using the 'version' argument
sip: Deprecation warning: sip/qt/qtmod.sip:23: %Module version number should be specified using the 'version' argument
sip: Deprecation warning: sip/qt/copying.sip:45: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/qt/copying.sip:46: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/pyqt-gpl.sip:1: %License annotations are deprecated, use arguments instead
sip: Deprecation warning: sip/qt/copying.sip:47: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/qt/copying.sip:48: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/qt/copying.sip:49: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead

Creating the Makefile for the qttable module...
Generating the C++ source for the qtxml module...
sip: Deprecation warning: sip/qtxml/qtxmlmod.sip:23: %Module version number should be specified using the 'version' argument
sip: Deprecation warning: sip/qt/qtmod.sip:23: %Module version number should be specified using the 'version' argument
sip: Deprecation warning: sip/qt/copying.sip:45: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/qt/copying.sip:46: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/pyqt-gpl.sip:1: %License annotations are deprecated, use arguments instead
sip: Deprecation warning: sip/qt/copying.sip:47: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
sip: Deprecation warning: sip/qt/copying.sip:48: %OptionalInclude is deprecated, use %Include and the 'optional' argument instead
 %Makefile is deprecated
Creating the Makefile for the qtxml module...
Creating top level Makefile...
Creating pyuic Makefile...
Creating pylupdate Makefile...
Creating pyqtconfig.py...





roy@roy-kubuntu:~/Downloads/PyQt-x11-gpl-3.18.1$ make
make[1]: Entering directory `/home/roy/Downloads/PyQt-x11-gpl-3.18.1/qt'
g++ -c -pipe -fPIC -O2 -Wall -W -DNDEBUG -DQT_NO_DEBUG -I. -I/usr/local/include/python2.6 -I/usr/local/qt/mkspecs/default -I/usr/local/qt/include -I/usr/X11R6/include -o sipqtcmodule.o sipqtcmodule.cpp
In file included from sip/qt/qimage.sip:139:0:
/usr/local/qt/include/qimage.h: In member function ‘bool QImageTextKeyLang::operator<(const QImageTextKeyLang&) const’:
/usr/local/qt/include/qimage.h:62:45: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
  { return key < other.key || key==other.key && lang < other.lang; }
                                             ^
sip/qt/qimage.sip: In function ‘const char** PyQt_qt_ListToArray(PyObject*)’:
sip/qt/qimage.sip:535:13: error: ‘ANY’ was not declared in this scope
sip/qt/qimage.sip:535:18: error: expected primary-expression before ‘)’ token
sip/qt/qobject.sip: At global scope:
sip/qt/qobject.sip:1256:1: warning: missing initializer for member ‘_heaptypeobject::as_number’ [-Wmissing-field-initializers]
sip/qt/qobject.sip:1256:1: warning: missing initializer for member ‘_heaptypeobject::as_mapping’ [-Wmissing-field-initializers]
sip/qt/qobject.sip:1256:1: warning: missing initializer for member ‘_heaptypeobject::as_sequence’ [-Wmissing-field-initializers]
sip/qt/qobject.sip:1256:1: warning: missing initializer for member ‘_heaptypeobject::as_buffer’ [-Wmissing-field-initializers]
sip/qt/qobject.sip:1256:1: warning: missing initializer for member ‘_heaptypeobject::ht_name’ [-Wmissing-field-initializers]
sip/qt/qobject.sip:1256:1: warning: missing initializer for member ‘_heaptypeobject::ht_slots’ [-Wmissing-field-initializers]
qt/sipqtcmodule.cpp:12287:1: warning: narrowing conversion of ‘PYQT_VERSION’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
make[1]: *** [sipqtcmodule.o] Error 1
make[1]: Leaving directory `/home/roy/Downloads/PyQt-x11-gpl-3.18.1/qt'
make: *** [all] Error 2
roy@roy-kubuntu:~/Downloads/PyQt-x11-gpl-3.18.1$
I don't know much about configuring gcc and/or c++ or even programming. I am still learning.

I'm hoping you can shed more light on this for me.

Regards,
Roy
 
Old 02-11-2015, 05:21 PM   #4
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Roy,

A caveat: I'm a C++/Qt user.

The link that you posted in an earlier thread (link), does not have a form.ui file or form.py file generated by pyuic. I found a form.py file here.

The changes required to make this app run with PyQt4 are relatively minor. I am attaching patch files for main.py and form.py.

Executing main.py, I get the form up and all of the buttons seem to work but I don't have a Hauppage device to test.

HTH
Attached Files
File Type: txt main.txt (926 Bytes, 21 views)
File Type: txt form.txt (12.8 KB, 13 views)
 
Old 02-11-2015, 06:28 PM   #5
rrrssssss
Member
 
Registered: Mar 2005
Posts: 288

Original Poster
Rep: Reputation: 34
Thank you norobro !

It worked fine with my hardware. I did have to comment out the "qt" line in the config.py file that did not have a patch (below).

Code:
# -*- coding: utf-8 -*-
import os.path
import commands
import main
#from qt import *
To me you are very smart to be able to program like that and make patches. I am not there yet.

So, thanks again for your time and trouble, but if you're like me, it was all fun.

Best regards,
Roy
 
Old 02-11-2015, 07:13 PM   #6
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
You're welcome. I'm glad it worked!

I migrated from Qt3 to Qt4 years ago so rather than smarts, it's experience. As I'm sure you noticed the changes were in syntax not logic.

Regarding patches, check out the diff manual page. The command to generate a patch file: diff -u old.file new.file > patch.file

Norm

Last edited by norobro; 02-11-2015 at 07:17 PM. Reason: typo
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Kubuntu 14.04 LTS Trusty Tahr : Video Review and Screenshot Tour LXer Syndicated Linux News 0 05-10-2014 10:10 AM
Kubuntu 14.04 - Trusty Tahr - Alpha1 mizrhappy Linux - Desktop 5 01-31-2014 06:07 PM
[SOLVED] compilling C++ source code (class) error hakeemtunde Programming 7 02-24-2011 07:17 AM
[SOLVED] kernel compilling-make module_install error Trishito Fedora 2 03-29-2010 12:36 PM
error after compilling kernel greklas Slackware 2 09-06-2004 01:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration