http://www.perlmonks.org?node_id=1001357

PoliceCoP has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks, I would very much appreciate your help with this issue - I have a hackathon coming up at the end of the week and would like to show off some Perl code. I posted this on Stackoverflow but have not yet received a reply. Thanks in advance ...

I can't build the QtCore4 package, I get an error regarding "SMOKE_QWT_LIBRARY" not being set during make. I'm running perlbrew Perl 5.14.2 on Ubuntu 12.04. I've tried manually building the module as well as through CPAN, and also installing on system Perl (also 5.14.2) and perl 5.16.1. I've looked in the files in the directory referenced in the error message. The file CMakeLists.txt contains the reference to "SMOKE_QWT_LIBRARY" but there is no directory reference or obvious way to re-configure the file (and I'm not sure what to reconfigure it to!).

Can anyone help with this please?

This is the make output:

Running install for module 'QtCore4' Running make for C/CB/CBUREL/Qt4- +0.99.0.tar.bz2 Checksum for /home/sillymoose/.cpan/sources/authors/id +/C/CB/CBUREL/Qt4- 0.99.0.tar.bz2 ok CPAN.pm: Building C/CB/CBUREL/Qt4-0.99.0.tar.bz2 -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Found Perl: /home/sillymoose/perl5/perlbrew/perls/perl- 5.14.2/bin/perl -- Found PerlLibs: /home/sillymoose/perl5/perlbrew/perls/perl- 5.14.2/lib/5.14.2/x86_64-linux/CORE/libperl.a (found version "5.14.2") -- Looking for Q_WS_X11 -- Looking for Q_WS_X11 - found -- Looking for Q_WS_WIN -- Looking for Q_WS_WIN - not found. -- Looking for Q_WS_QWS -- Looking for Q_WS_QWS - not found. -- Looking for Q_WS_MAC -- Looking for Q_WS_MAC - not found. -- Found Qt4: /usr/bin/qmake (found version "4.8.1") -- Found QScintilla2: /usr/lib/libqscintilla2.so -- Found QImageBlitz: /usr/include/qimageblitz -- Phonon Version: 4.6.0 -- Found Phonon: /usr/lib/x86_64-linux-gnu/libphonon.so -- Found Phonon Includes: /usr/include/qt4/KDE;/usr/include/qt4 -- Found Qwt: /usr/lib/libqwt-qt4.so -- Perl headers found: /home/sillymoose/perl5/perlbrew/perls/perl- 5.14.2/lib/5.14.2/x86_64-linux/CORE -- Perl headers found: /home/sillymoose/perl5/perlbrew/perls/perl- 5.14.2/lib/5.14.2/x86_64-linux/CORE -- Build PerlQt bindings: Phonon;QImageBlitz;QScintilla;Qt3Support;QtDBus;QtDeclarative;QtGui;Qt +He lp;QtNetwork;QtOpenGL;QtScript;QtSql;QtSvg;QtTest;QtUiTools;QtWebKit;Q +tX ml;QtXmlPatterns;Qwt -- Skip PerlQt bindings: QtMultimedia ---------------------------------------------------------------------- +-- ----- -- The following external packages were located on your system. -- This installation will have the extra features provided by these packages. ---------------------------------------------------------------------- +-- ----- * QScintilla2 - QScintilla2 libraries * QImageBlitz - QImageBlitz library * Phonon - Phonon multimedia framework * Qwt5 for Qt4 - Qwt5 libraries for Qt4 ---------------------------------------------------------------------- +-- ----- -- Congratulations! All external packages have been found. ---------------------------------------------------------------------- +-- ----- CMake Error: The following variables are used in this project, but the +y are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: SMOKE_QWT_LIBRARY (ADVANCED) linked by target "perl_qwt" in directory /home/sillymoose/.cpan/build/Qt4-0.99.0-5Qxy7L/qwt/src -- Configuring incomplete, errors occurred! No 'Makefile' created CBUREL/Qt4-0.99.0.tar.bz2 /home/sillymoose/perl5/perlbrew/perls/perl-5.14.2/bin/perl Makefile. +PL -- NOT OK

And this is the contents of ~/.cpan/build/Qt4-0.99.0-5Qxy7L/qwt/src/CMakeLists.txt

include_directories( ${CMAKE_SOURCE_DIR}/qtcore/src ${PERL_INCLUDE_PATH} ${QT_INCLUDES} ) # Run doxsubpp.pl to run xsubpp on Qwt.xs add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Qwt.c COMMAND ${PERL_EXECUTABLE} ARGS ${CMAKE_SOURCE_DIR} +/qtcore/src/doxsubpp.pl ${PERL_EXECUTABLE} Qwt.xs ${CMAKE_CURRENT_BIN +ARY_DIR}/Qwt.c DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Qwt.xs WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) # Make sure we build Qwt.c as c++ code set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/Qwt.c PROPERTIES LANGUAGE CXX ) set( CMAKE_CXX_FLAGS ${PERL_CXX_FLAGS} ) set(qwt_LIBRARY_SRC ${CMAKE_CURRENT_BINARY_DIR}/Qwt.c qwthandlers.cpp ) if(WIN32) set(libraryName PerlQwt) else() set(libraryName Qwt) endif(WIN32) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/blib/arch/auto/${libraryNa +me}) add_library(perl_qwt SHARED ${qwt_LIBRARY_SRC}) target_link_libraries(perl_qwt ${SMOKE_QWT_LIBRARY} perlqtcore4) set_target_properties(perl_qwt PROPERTIES OUTPUT_NAME ${libraryName}) set_target_properties(perl_qwt PROPERTIES PREFIX "") install(TARGETS perl_qwt DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto +/${libraryName}/)

Replies are listed 'Best First'.
Re: Perl QtCore4 won't install
by daxim (Curate) on Oct 29, 2012 at 13:31 UTC
    That distro is outdated. Check out code from the official repository instead. You didn't say what version of Qt you are running, so I'm linking to the main branch.

    As with any C-library, you need the appropriate header files from the packages libsmokeqt-devel and libqt4-devel at the least. These are the OpenSUSE names, you need to figure out the debianised equivalents yourself.

      Thanks daxim. I'm not sure I understand how qtcore4-0.99.0 is an older version than qtcore4-0.96.0. Or were you referring to another library? I have installed the debian packages (libqt4-dev, libsmokeqt4-dev) and loads more I have qt 4.8.2 installed. From here when I try

       cpan QtCore4

      it tries to build smokeqt I think, and fails here:

      Scanning dependencies of target perlqtcore4 [ 68%] Building CXX object qtcore/src/CMakeFiles/perlqtcore4.dir/bindi +ng.cpp.o [ 68%] Building CXX object qtcore/src/CMakeFiles/perlqtcore4.dir/handl +ers.cpp.o [ 69%] Building CXX object qtcore/src/CMakeFiles/perlqtcore4.dir/marsh +all_types.cpp.o [ 69%] Building CXX object qtcore/src/CMakeFiles/perlqtcore4.dir/util. +cpp.o /home/sillymoose/.cpan/build/Qt4-0.99.0-sLJsAg/qtcore/src/util.cpp: In + function ‘void XS_signal(CV*)’: /home/sillymoose/.cpan/build/Qt4-0.99.0-sLJsAg/qtcore/src/util.cpp:238 +5:110: warning: format ‘%lu’ expects argument of type ‘long unsigned +int’, but argument 3 has type ‘line_t {aka unsigned int}’ [-Wformat] [ 70%] Building CXX object qtcore/src/CMakeFiles/perlqtcore4.dir/QtCor +e4.c.o QtCore4.xs: In function ‘void XS_Qt___internal_sv_obj_info(CV*)’: QtCore4.xs:403:9: warning: format ‘%x’ expects argument of type ‘unsig +ned int’, but argument 2 has type ‘IV {aka long int}’ [-Wformat] Linking CXX shared library ../../blib/arch/auto/QtCore4/QtCore4.so /usr/bin/ld: /home/sillymoose/perl5/perlbrew/perls/perl-5.14.2/lib/5.1 +4.2/x86_64-linux/CORE/libperl.a(op.o): relocation R_X86_64_32S agains +t `PL_sv_yes' can not be used when making a shared object; recompile +with -fPIC /home/sillymoose/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/x86_64-li +nux/CORE/libperl.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[2]: *** [blib/arch/auto/QtCore4/QtCore4.so] Error 1 make[1]: *** [qtcore/src/CMakeFiles/perlqtcore4.dir/all] Error 2 make: *** [all] Error 2

      what do you think? Thanks again.

Re: Perl QtCore4 won't install
by Anonymous Monk on Oct 29, 2012 at 16:03 UTC

      Thanks for the pointer. I followed the steps described here, by installing the base libraries, then cloning the git repositories and building them. smokegen and smokeqt compile fine, however when I try to make perlqt, i get the following error:

      sudo make Scanning dependencies of target perlqtcore4pm [ 0%] Built target perlqtcore4pm Scanning dependencies of target perlqt4pmlibmkdir [ 0%] Built target perlqt4pmlibmkdir Scanning dependencies of target perlqt4pmlibsubdir [ 0%] Built target perlqt4pmlibsubdir [ 1%] Generating QtCore4.c Scanning dependencies of target perlqtcore4 [ 2%] Building CXX object qtcore/src/CMakeFiles/perlqtcore4.dir/bindi +ng.cpp.o [ 4%] Building CXX object qtcore/src/CMakeFiles/perlqtcore4.dir/handl +ers.cpp.o [ 5%] Building CXX object qtcore/src/CMakeFiles/perlqtcore4.dir/marsh +all_types.cpp.o [ 6%] Building CXX object qtcore/src/CMakeFiles/perlqtcore4.dir/util. +cpp.o /home/sillymoose/Downloads/perlqt/qtcore/src/util.cpp: In function ‘vo +id XS_signal(CV*)’: /home/sillymoose/Downloads/perlqt/qtcore/src/util.cpp:2385:110: warnin +g: format ‘%lu’ expects argument of type ‘long unsigned int’, but arg +ument 3 has type ‘line_t {aka unsigned int}’ [-Wformat] [ 8%] Building CXX object qtcore/src/CMakeFiles/perlqtcore4.dir/QtCor +e4.c.o QtCore4.xs: In function ‘void XS_Qt___internal_sv_obj_info(CV*)’: QtCore4.xs:403:9: warning: format ‘%x’ expects argument of type ‘unsig +ned int’, but argument 2 has type ‘IV {aka long int}’ [-Wformat] Linking CXX shared library ../../blib/arch/auto/QtCore4/QtCore4.so /usr/bin/ld: /home/sillymoose/perl5/perlbrew/perls/perl-5.14.2/lib/5.1 +4.2/x86_64-linux/CORE/libperl.a(op.o): relocation R_X86_64_32S agains +t `PL_sv_yes' can not be used when making a shared object; recompile +with -fPIC /home/sillymoose/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/x86_64-li +nux/CORE/libperl.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[2]: *** [blib/arch/auto/QtCore4/QtCore4.so] Error 1 make[1]: *** [qtcore/src/CMakeFiles/perlqtcore4.dir/all] Error 2 make: *** [all] Error 2

      can you help please?