Page 1 of 2 12 LastLast
Results 1 to 20 of 28

Thread: QT minimum build to start developing

  1. #1
    Join Date
    Aug 2009
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default 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.

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default 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.

  3. #3
    Join Date
    Aug 2009
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default 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?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Aug 2009
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT minimum build to start developing

    Quote Originally Posted by wysota View Post
    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

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QT minimum build to start developing

    Missing what exactly?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Aug 2009
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default 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?

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default 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).

    Qt Code:
    1. ./configure -prefix /usr/local/qt-4.5.2 -nomake demos -nomake examples -no-qt3support
    2. -no-accessibility -no-phonon -no-phonon-backend -no-webkit
    To copy to clipboard, switch view to plain text mode 

    But it may differ from your needs, because i don't know what kind of application you want to develop.
    I'm a rebel in the S.D.G.

  10. #10
    Join Date
    Aug 2009
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT minimum build to start developing

    Quote Originally Posted by wysota View Post
    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.

  11. #11
    Join Date
    Aug 2009
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT minimum build to start developing

    Quote Originally Posted by lyuts View Post
    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).

    Qt Code:
    1. ./configure -prefix /usr/local/qt-4.5.2 -nomake demos -nomake examples -no-qt3support
    2. -no-accessibility -no-phonon -no-phonon-backend -no-webkit
    To copy to clipboard, switch view to plain text mode 

    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?
    Last edited by lurky; 26th August 2009 at 16:19.

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QT minimum build to start developing

    Quote Originally Posted by lurky View Post
    Of course I did NOT changed the libraries code but just played with makefiles.
    Makefiiles get regenerated when you run configure.

    But for safety reasons I reinstalled the SDK.
    Pure waste of time, especially that the SDK is built for MinGW.

    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 View Post
    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.

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  13. #13
    Join Date
    Aug 2009
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT minimum build to start developing

    Quote Originally Posted by wysota View Post
    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 View Post
    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 View Post
    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.

  14. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QT minimum build to start developing

    Quote Originally Posted by lurky View Post
    But I need all the SDK to have designer, linguist and other tools. Correct?
    Incorrect.

    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.

    How can I achieve this?
    Call nmake with appropriate target names (such as sub-src).

    What about my assumption about minimum set of required files/folders?
    What about it?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  15. #15
    Join Date
    Aug 2009
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default 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.
    Last edited by lurky; 27th August 2009 at 15:29.

  16. #16
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  17. #17
    Join Date
    Apr 2008
    Location
    Russia, Moscow
    Posts
    86
    Thanks
    2
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4

    Default Re: QT minimum build to start developing (built and copied on a new pc)

    Quote Originally Posted by wysota View Post
    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.

  18. #18
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  19. #19
    Join Date
    Apr 2008
    Location
    Russia, Moscow
    Posts
    86
    Thanks
    2
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4

    Default Re: QT minimum build to start developing (built and copied on a new pc)

    Quote Originally Posted by wysota View Post
    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:
    Qt Code:
    1. [Paths]
    2. Prefix=full_path_name_to_new_root_Qt_directory
    To copy to clipboard, switch view to plain text mode 

    Then open terminal, compiling any Qt project.

  20. #20
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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.
    bash Code:
    1. export QTDIR=/tmp
    2. mkdir /tmp/bin
    3. echo "[Paths]" > /tmp/bin/qt.conf
    4. echo "Prefix=/opt/" >> /tmp/bin/qt.conf
    5. mkdir /tmp/testbed
    6. cd /tmp/testbed
    7. touch main.cpp
    8. qmake -project
    9. qmake
    10. make
    To copy to clipboard, switch view to plain text mode 

    Result:
    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Build error on mac Platform::WaitMouseMoved
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 12th July 2007, 14:18

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.