Problem compiling with QT4 libraries

Asked by Daniel Marrable

I am having trouble getting pbuilder or launchpad to build a package that uses the QT4 libraries.

The build script that I am using is below ( I didn't write it ). It compiles fine on a vanilla instance of Vivid (on a VM) but not using pbuilder.

A copy of the project is hosted here http://bazaar.launchpad.net/~marrabld/planarrad/trunk/files

The error I am getting is here http://pastebin.com/MfAZnbdY

Any help would be greatly appreciated!

[build script]

#!/bin/sh
export JUDE2DIR=/opt/jude2_install
export LD_LIBRARY_PATH=$JUDE2DIR/lib:$LD_LIBRARY_PATH
export PATH=$JUDE2DIR/bin:$PATH
# create configure script - has been be done already so commented out
# ./autogen.sh

# builds directory that with symlinks looks like how the build process
# expects to find qt4 layed out
rm -rf pretend_qt4_dir
mkdir pretend_qt4_dir
mkdir pretend_qt4_dir/bin
ln -s /usr/bin/moc-qt4 pretend_qt4_dir/bin/moc
ln -s /usr/bin/qmake-qt4 pretend_qt4_dir/bin/qmake
ln -s /usr/bin/rcc pretend_qt4_dir/bin/rcc
ln -s /usr/bin/uic-qt4 pretend_qt4_dir/bin/uic
# this is the difference between Ferdora 19 and Ubuntu 13.04
# Fedora
if [ -e /usr/lib64/libQtCore.so ]; then
  ln -s /usr/lib64 pretend_qt4_dir/lib
  ln -s /usr/include pretend_qt4_dir/include
# Ubuntu
else
  ln -s /usr/lib/x86_64-linux-gnu pretend_qt4_dir/lib
  ln -s /usr/include/qt4 pretend_qt4_dir/include
fi

# this is the full path to a directory that using symlinks looks like
# how the build process expects qt4 to be layed out
PRETENDQT4DIR=$(pwd)"/pretend_qt4_dir"

# make a directory to build in
rm -rf build
mkdir -p build

# change to that directory
cd build

# to build command line version only without qt use option --disable-qt
../configure --prefix=$JUDE2DIR --with-qtdir=$PRETENDQT4DIR

# compile
make

# copy to $JUDE2DIR, if under /usr/local you probably need root priviliges
# so if this fails try 'sudo make install'
#make install

[Error]

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Daniel Marrable
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

It seems to be an error in the configure script:

line 828 defines
x_libraries=NONE

but line 15911 checks for
            if test "x$x_libraries" != x ; then
                QT_LIBS="$QT_LIBS -L$x_libraries"

This leads to QT_LIBS containing
-lQtCore -lQtGui -lQt3Support -LNONE
and later the linker fails to find a directory NONE

I do not know where that comes from.

changing line 15912 to
            if test "x$x_libraries" != xNONE ; then

might help.

Revision history for this message
Daniel Marrable (marrabld) said :
#2

Thanks for your reply. It passes that particular problem and then gives me this

require no space between `-L' and `-lXext'

I think that now it is not finding the qtdir at all and hence empty -L

It seems to be trying to compile using static QT libraries, where as usually, on my machine, it links dynamically. I think it is doing this because it isn't finding the correct QT directory.

Why would pbuilder put them in a different location to my vanilla instance of Vivid?

Revision history for this message
Daniel Marrable (marrabld) said :
#3

Okay, I got it to compile on pbuilder now. I changed

export JUDE2DIR=/opt/jude2_install
export LD_LIBRARY_PATH=$JUDE2DIR/lib:$LD_LIBRARY_PATH
export PATH=$JUDE2DIR/bin:$PATH

to

JUDE2DIR=/opt/jude2_install
LD_LIBRARY_PATH=$JUDE2DIR/lib:$LD_LIBRARY_PATH
PATH=$JUDE2DIR/bin:$PATH

and to make sure, I deleted all of the source code, redownloaded from repo and made the debian file from scratch. Something in that process seems to have got the linking worked out.

Thanks

Revision history for this message
Colin Watson (cjwatson) said :
#4

You're almost certainly missing some Build-Depends on X development packages. I'd suggest starting by adding libx11-dev to Build-Depends in debian/control.

Incidentally, you can probably also drop "libqtcore4, libqtgui4, libqt4-qt3support" from Build-Depends; libqt4-dev depends on them anyway, and it's normally a mistake to build-depend directly on run-time library packages rather than (or, as in this case, as well as) development library packages. You should also consider whether it's really appropriate for your package's Depends to contain most of the stuff from Build-Depends.

Revision history for this message
Daniel Marrable (marrabld) said :
#5

Thanks Colin,

I will make the changes that you suggest. I am learning as I go here, there is a lot to get my head around.