automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: building a qt library


From: Lorenzo Bettini
Subject: Re: building a qt library
Date: Sun, 30 Nov 2008 14:24:30 +0100
User-agent: Thunderbird 2.0.0.18 (X11/20081125)

Craig Sanders wrote:
Lorenzo Bettini <address@hidden> wrote:>
Craig Sanders wrote:
Greetings Lorenzo.

I have used the GNU Autotools in the past to build some simple
projects which made use of the Qt Library. I prefer to use the GNU
Autotools as I find them much more flexible and much more powerful than
qmake.

As I recall, there are 2 key steps that need to be performed when
using the GNU Autotools with Qt.

Step 1, You will need to get hold of an Autoconf macro which will
detect if and if so, where you have a Qt Library installed on your
system. If this macro detects that you have a Qt Library installed on
your system, then it will generate some appropriate settings for you.

Step 2, You will also need to instruct the Autotools how to invoke
the Qt moc (Meta Object Compiler) on your relevant source code files.

To accomplish the first step, you should be able to find an
appropriate Autoconf macro here ;

  http://autoconf-archive.cryp.to/macros-by-category.html

Personally, I use the macro bnv_have_qt - information about which can
be found here ;

  http://autoconf-archive.cryp.to/bnv_have_qt.html

I then call this macro from my configure.ac file as is illustrated
below.
<SNIP>

Hi Craig

thanks a lot for your answer!

I've just tried this macro on a brand new empty project...  I'm testing
it under windows with cygwin, and it seems to fail: I run configure like
this

./configure --with-Qt-lib-dir=/usr/lib/qt3/lib/
--with-Qt-include-dir=/usr/include/qt3/
--with-Qt-bin-dir=/usr/lib/qt3/bin/ --with-Qt-lib=qt

and I get

checking for Qt... yes:
     QT_CXXFLAGS=-I/usr/include/qt3/
     QT_DIR=
     QT_LIBS=-L/usr/lib/qt3/lib/ -lqt  -lSM -lICE  -lX11 -lXext -lXmu
-lXt -lXi
     QT_UIC=/usr/lib/qt3/bin//uic
     QT_MOC=/usr/lib/qt3/bin//moc
     QT_LRELEASE=/usr/lib/qt3/bin//lrelease
     QT_LUPDATE=/usr/lib/qt3/bin//lupdate
checking correct functioning of Qt installation... failure
configure: error: Failed to find matching components of a complete
                   Qt installation. Try using more options,
                   see ./configure --help.

Actually, the link phase of the test example fails...  have you even
tried your project under cygwin?

cheers
        Lorenzo

Hello again Lorenzo.


Hi Craig

I haven't tried configuring and building my Qt project using Cygwin under 
Windows. Rather, I have only configured and built it under Linux Fedora Core 2 
and using the default Qt installation (version 3.3) that is distributed with it.

If I invoke the following switch ;

  --with-Qt-dir


I used this switch too, actually I used the more complete form (otherwise headers and libraries would not be found at all)

when I run the configure script, then my project successfully configures and 
compiles. This has always worked for me, so I haven't bothered to try using any 
of the other Qt related configure script switches, i.e. --with-Qt-lib-dir, etc.

You could maybe try using this approach, and if you find that it doesn't work 
for you then you could perhaps send an e-mail to the author of the bnv_have_qt 
macro. I don't use Windows for software development, so I'm not sure what you 
would need to do in order to get the bnv_have_qt macro to find your Qt 
installation using just this one configure script switch. Sorry I can't be of 
more any more help.


as I said, libraries and headers (and also tools) are correctly found, but it does not seem to succeed in the linking phase (of the configure test)... with a qmake project and makefile instead it seems to work...

I've already emailed to the author as well :-)

I don't develop under windows either (using Linux instead), but I always port my programs in windows using cygwin, that's why I was concerned...

Under linux that macro works perfectly...

I was also thinking of using the pkg-config approach, since qt ships the .pc files

Good luck with it.

thanks!
hope to have some good news soon :-)

cheers
        Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]