Results 1 to 8 of 8

Thread: building qt statically

  1. #1
    Join Date
    Nov 2006
    Posts
    96

    Default building qt statically

    Hi, I'm trying to build qt statically. I configured with this command.
    Qt Code:
    1. ./configure -static --prefix=/sources/qt/ && make
    To copy to clipboard, switch view to plain text mode 


    But when I issued make, I got this error:
    ct-2.0 -lSM -lICE -pthread -pthread -lXrender -lfontconfig -lXext -lX11 -lQtNetwork -pthread -pthread -lQtCore -lz -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -lpthread -ldl
    .obj/release-static/main.o: In function `__static_initialization_and_destruction_0(int, int)':
    main.cpp.text+0x1b): undefined reference to `qt_plugin_instance_qsqlite()'
    collect2: ld returned 1 exit status
    make[4]: *** [../../../../bin/assistant] Error 1
    make[4]: Leaving directory `/sources/qt-x11-opensource-src-4.5.0/tools/assistant/tools/assistant'
    make[3]: *** [sub-assistant-make_default-ordered] Error 2
    make[3]: Leaving directory `/sources/qt-x11-opensource-src-4.5.0/tools/assistant/tools'
    make[2]: *** [sub-tools-make_default-ordered] Error 2
    make[2]: Leaving directory `/sources/qt-x11-opensource-src-4.5.0/tools/assistant'
    make[1]: *** [sub-assistant-make_default-ordered] Error 2
    make[1]: Leaving directory `/sources/qt-x11-opensource-src-4.5.0/tools'
    make: *** [sub-tools-make_default-ordered] Error 2
    Any ideas?

  2. #2
    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: building qt statically

    You didn't build the static plugins. But anyway it's not worth building the tools in static mode so you don't have to have assistant compiled.
    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.


  3. #3
    Join Date
    Nov 2006
    Posts
    96

    Default Re: building qt statically

    Hi, I tried compiling it like this:

    Qt Code:
    1. ./configure -static --prefix=/sources/qt/ -release -no-exceptions && make && make sub-src
    To copy to clipboard, switch view to plain text mode 

    and I get this error:
    .obj/release-static/main.o: In function `__static_initialization_and_destruction_0(int, int)':
    main.cpp.text+0x1b): undefined reference to `qt_plugin_instance_qsqlite()'
    collect2: ld returned 1 exit status
    make[4]: *** [../../../../bin/assistant] Error 1
    make[4]: Leaving directory `/sources/qt-x11-opensource-src-4.5.0/tools/assistant/tools/assistant'
    make[3]: *** [sub-assistant-install_subtargets-ordered] Error 2
    make[3]: Leaving directory `/sources/qt-x11-opensource-src-4.5.0/tools/assistant/tools'
    make[2]: *** [sub-tools-install_subtargets-ordered] Error 2
    make[2]: Leaving directory `/sources/qt-x11-opensource-src-4.5.0/tools/assistant'
    make[1]: *** [sub-assistant-install_subtargets-ordered] Error 2
    make[1]: Leaving directory `/sources/qt-x11-opensource-src-4.5.0/tools'
    make: *** [sub-tools-install_subtargets-ordered] Error 2
    so, pretty much the same error as above. Can you tell me how to not build with assistant support?

  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: building qt statically

    You should only make sub-src, not everything (so remove the first "make").
    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
    Nov 2006
    Posts
    96

    Default Re: building qt statically

    Hi, ok the package was build successfully...then I added the "CONFIG += static" to the *.pro file and run "make distclean && qmake && make" but it's still not build statically, look at this:

    eleanor-laptop client # file ./client
    ./client: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), not stripped
    eleanor-laptop client # ldd ./client
    linux-gate.so.1 => (0xb7fe8000)
    libxerces-c-3.0.so => /usr/lib/libxerces-c-3.0.so (0xb7c38000)
    libpng12.so.0 => /usr/lib/libpng12.so.0 (0x4d9ee000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x44d68000)
    libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x450cb000)
    libSM.so.6 => /usr/lib/libSM.so.6 (0x45115000)
    libICE.so.6 => /usr/lib/libICE.so.6 (0x45121000)
    libXrender.so.1 => /usr/lib/libXrender.so.1 (0x44fa6000)
    libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x4d9b6000)
    libXext.so.6 => /usr/lib/libXext.so.6 (0x44e07000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0x44c4c000)
    libz.so.1 => /lib/libz.so.1 (0x44c34000)
    libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x44149000)
    librt.so.1 => /lib/librt.so.1 (0x43fe2000)
    libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x44fde000)
    libdl.so.2 => /lib/libdl.so.2 (0x44c15000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x44c1b000)
    libstdc++.so.6 => /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6 (0x44e49000)
    libm.so.6 => /lib/libm.so.6 (0x44bed000)
    libgcc_s.so.1 => /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libgcc_s.so.1 (0x44f36000)
    libc.so.6 => /lib/libc.so.6 (0x44abb000)
    libnsl.so.1 => /lib/libnsl.so.1 (0x445f1000)
    libexpat.so.1 => /usr/lib/libexpat.so.1 (0x4d988000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x44d59000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x44d5f000)
    /lib/ld-linux.so.2 (0x43fc4000)
    eleanor-laptop client #
    So, what seems to be the problem? Any ideas are appreciated!

  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: building qt statically

    Sure it is built statically - look that the appliation doesn't have Qt listed in its dependencies. If you want other libs embedded statically, you need them available in static version when building Qt and your application.
    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
    Nov 2006
    Posts
    96

    Default Re: building qt statically

    And how to do that? Can you provide a link to some tutotrial?

  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: building qt statically

    You need a static version of each of the libraries. Most popular ones usually have dedicated packages with static versions, others you'd have to compile yourself.
    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. LNK2005 error in VS2005 when statically building Qt App
    By pkloc in forum General Programming
    Replies: 9
    Last Post: 2nd July 2011, 01:36
  2. Which Linux distribution is best for building compatible apps?
    By Oxidative in forum Installation and Deployment
    Replies: 8
    Last Post: 9th July 2009, 16:13
  3. Application seems not to be linked statically
    By Boron in forum Installation and Deployment
    Replies: 5
    Last Post: 2nd April 2008, 17:14
  4. Failure when building QT on Windows with MinGW
    By sharon in forum Installation and Deployment
    Replies: 2
    Last Post: 23rd August 2007, 13:38
  5. Statically Linking... everything
    By bpetty in forum Newbie
    Replies: 5
    Last Post: 26th October 2006, 17:43

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.