QT minimum build to start developing
Hello,
I just started playing with QT but have an uncertainty about building it under VS2008.
I used the following configuration command
configure -debug-and-release -opensource -static -platform win32-msvc2008
followed by the suitable "nmake" command, but after several hours of compiling I noticed that also tutorials, demos, examples and a lot of other stuff were compiled, so that the "qt" folder was over 8GB in size (I then stopped building).
Is there a way (configuration parameter? makefile editing?) to build only the parts needed to start developing projects? (I think just .lib files for static building and .lib + .dll for dynamic, correct?)
Thanks a lot.
Re: QT minimum build to start developing
Its a subdirs project so it will compile everything inside.
As quick work around, rename examples and demos folder before config and build.;)
Re: QT minimum build to start developing
Thank you.
So if I want to carry around my "minimum build" which folders are necessary?
Should I need only "include", "bin" and "lib" folders?
Re: QT minimum build to start developing
Try configure -help and see if Windows release contains options to disable building examples, demos, etc. It should be called something like "-no-make-examples" and similar.
Re: QT minimum build to start developing
Quote:
Originally Posted by
wysota
Try configure -help and see if Windows release contains options to disable building examples, demos, etc. It should be called something like "-no-make-examples" and similar.
that was the first think I looked for and unfortunately there is not such an options
I also tried the '-fast' switch and then used 'nmake' from inside the 'src' folder but this ended up with a 'missing something' error
Re: QT minimum build to start developing
Re: QT minimum build to start developing
I don't remember if the error was related to a missing file or to an unresolved reference during linking, anyway I found that my installation of the QT SDK may have been damaged after all my trials so I'm going to install it again.
Theoretically, using configure with -fast switch and then nmake from inside the src folder has a sense?
I'm starting to think that my only possibilty is to manually edit the Makefile (after configure without -fast) or the projects.pro (before configure) in the %QTDIR%, what do you think about?
Re: QT minimum build to start developing
It couldn't have been damaged unless you started changing the source code of Qt which I assume you didn't. Don't touch the makefiles. Configure Qt as usual, cd into src and call nmake.
Re: QT minimum build to start developing
I'm sure everybody understands "minimum build" in his own way. Here is how i do my minimum build (e.g. Qt 4.5.2).
Code:
./configure -prefix /usr/local/qt-4.5.2 -nomake demos -nomake examples -no-qt3support
-no-accessibility -no-phonon -no-phonon-backend -no-webkit
But it may differ from your needs, because i don't know what kind of application you want to develop.
Re: QT minimum build to start developing
Quote:
Originally Posted by
wysota
It couldn't have been damaged unless you started changing the source code of Qt which I assume you didn't. Don't touch the makefiles. Configure Qt as usual, cd into src and call nmake.
Update.
Of course I did NOT changed the libraries code but just played with makefiles. But for safety reasons I reinstalled the SDK. Then I started a new building (full, including demos, tutorials, examples) and got an "unresolved reference" while building WebKit. I finally restarted a new building with -WebKit switch and it was successful (or so it looks...).
The final size of the Qt folder is a bit more than 3GB, which is acceptable compared to the 8Gb and more of my first trial.
Now, how can I just build WebKit?
Thanks to all the ones who may help.
Re: QT minimum build to start developing
Quote:
Originally Posted by
lyuts
I'm sure everybody understands "minimum build" in his own way. Here is how i do my minimum build (e.g. Qt 4.5.2).
Code:
./configure -prefix /usr/local/qt-4.5.2 -nomake demos -nomake examples -no-qt3support
-no-accessibility -no-phonon -no-phonon-backend -no-webkit
But it may differ from your needs, because i don't know what kind of application you want to develop.
I'm building in Windows targetting to VS2005, and -prefix is not listed in configure help: what is it for?
Anyway my meaning for "minimum" is the smallest set of files needed to develop an application (with all the possible libraries) using the VS2005 integration.
So I think I would:
- need folders 'include', 'lib', 'plugins' and 'bin'
- not need folders 'src', 'examples', 'tutorials', 'demos'
- don't know about remaining files and folders
Am I correct?
Re: QT minimum build to start developing
Quote:
Originally Posted by
lurky
Of course I did NOT changed the libraries code but just played with makefiles.
Makefiiles get regenerated when you run configure.
Quote:
But for safety reasons I reinstalled the SDK.
Pure waste of time, especially that the SDK is built for MinGW.
Quote:
Now, how can I just build WebKit?
Giving information that you encountered some error isn't really helpful. I could only reply you needed to do something to make them go away.
Quote:
Originally Posted by
lurky
I'm building in Windows targetting to VS2005, and -prefix is not listed in configure help: what is it for?
It's for installing the binaries outside the source tree. But it's unavailable on Windows.
Quote:
Anyway my meaning for "minimum" is the smallest set of files needed to develop an application (with all the possible libraries) using the VS2005 integration.
You need to build the sub-src, sub-tools and possibly the plugins targets then.
Re: QT minimum build to start developing
Quote:
Originally Posted by
wysota
Pure waste of time, especially that the SDK is built for MinGW.
But I need all the SDK to have designer, linguist and other tools. Correct?
Quote:
Originally Posted by
wysota
Giving information that you encountered some error isn't really helpful. I could only reply you needed to do something to make them go away.
You're absolutely right, unfortunately I did not take a note of the exact error but if there's a way to build just WebKit I can make a fast try.
Quote:
Originally Posted by
wysota
You need to build the sub-src, sub-tools and possibly the plugins targets then.
How can I achieve this?
What about my assumption about minimum set of required files/folders?
Thank you for you answers.
Re: QT minimum build to start developing
Quote:
Originally Posted by
lurky
But I need all the SDK to have designer, linguist and other tools. Correct?
Incorrect.
Quote:
You're absolutely right, unfortunately I did not take a note of the exact error but if there's a way to build just WebKit I can make a fast try.
Configure with WebKit, cd into appropriate directory and run nmake. Note that Qt libraries need to be compiled first.
Quote:
How can I achieve this?
Call nmake with appropriate target names (such as sub-src).
Quote:
What about my assumption about minimum set of required files/folders?
What about it?
Re: QT minimum build to start developing (built and copied on a new pc)
Update.
Uninstalled the SDK, downloaded the
qt-win-opensource-src-4.5.2.zip
package, made configure and then nmake.
Building was completed with no errors.
Finally I got a fully working installation of QT with VS2005 integration on the machine I used to build...
but
...I then took the whole 'qt' folder to a different machine (let's say %BUILD_PATH% is were libraries were built and %NEW_PATH% is were they are located on the other machine), configured there the %QTDIR% = %NEW_PATH%, added %QTDIR%\bin to the %path%, and I'm able to open/create QT projects with the suitable 'qt designer'; the only problem is that if I try to open the help I got the error
"The binary '%BUILD_PATH%\bin\assistant.exe' does not exist."
How can I fix this?
The question in my previous post would mean: once I got the full built libraries which are the files needed to develop QT applications? (I think I should not need folders 'src', 'examples', 'tutorials', 'demos'.....)
Thanks.
Re: QT minimum build to start developing (built and copied on a new pc)
You can't move an existing installation to a different path without recompilation (or patching the binaries).
Re: QT minimum build to start developing (built and copied on a new pc)
Quote:
Originally Posted by
wysota
You can't move an existing installation to a different path without recompilation (or patching the binaries).
You can, just need create qt.conf file with new path.
Re: QT minimum build to start developing (built and copied on a new pc)
As far as I know qt.conf doesn't apply to qmake. Or does it?
Re: QT minimum build to start developing (built and copied on a new pc)
Quote:
Originally Posted by
wysota
As far as I know qt.conf doesn't apply to qmake. Or does it?
Does it. Try for yourself. Rename %QTDIR% root directory to other name, next go to new %QTDIR%/bin and create inside - file qt.conf with this content:
Code:
[Paths]
Prefix=full_path_name_to_new_root_Qt_directory
Then open terminal, compiling any Qt project.
Re: QT minimum build to start developing (built and copied on a new pc)
It doesn't work. It still points to the original path.
Code:
export QTDIR=/tmp
mkdir /tmp/bin
echo "[Paths]" > /tmp/bin/qt.conf
echo "Prefix=/opt/" >> /tmp/bin/qt.conf
mkdir /tmp/testbed
cd /tmp/testbed
touch main.cpp
qmake -project
qmake
make
Result:
Quote:
g++ -c -pipe -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/lib/qt4/include/QtCore -I/usr/lib/qt4/include/QtGui -I/usr/lib/qt4/include -I. -I. -o main.o main.cpp
g++ -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -o testbed main.o -L/usr/lib -lQtGui -L/usr/lib -pthread -lpng -lfreetype -lgobject-2.0 -lSM -lICE -pthread -pthread -lXrender -lfontconfig -lXext -lX11 -lQtCore -lz -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lpthread
As for me if it worked, it should have complained about missing specs but it's still seeing my installation at /usr/lib/qt4.
Even after linking qmake to /tmp/bin/qmake:
$ ./qmake -v
QMake version 2.01a
Using Qt version 4.5.2 in /usr/lib
and:
$ env|grep QTDIR
QTDIR=/tmp
Am I doing something wrong?
I think that if it was that simple, Qt installation script wouldn't be patching qmake binaries.