Results 1 to 9 of 9

Thread: Static linking problems.

  1. #1
    Join Date
    Oct 2007
    Location
    Moscow, Russia
    Posts
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Static linking problems.

    Hi!
    I am trying to build static .exe using Qt 4.3.2 under Windows Xp. Everything was ok with dynamic linking. My steps were: "configure -static" and "mingw32-make" to rebuild Qt. After rebuilding I tried to compile my program and got error:
    Qt Code:
    1. In file included from main.cpp:2:
    2. stat.h: In member function `void Stat::sendData(const QString&, const QString&)'
    3. :
    4. stat.h:41: error: `QSslSocket' undeclared (first use this function)
    5. stat.h:41: error: (Each undeclared identifier is reported only once for each fun
    6. ction it appears in.)
    7. stat.h:41: error: `socket' undeclared (first use this function)
    8. stat.h:41: error: `QSslSocket' has not been declared
    To copy to clipboard, switch view to plain text mode 

    line 41 in stat.h:

    Qt Code:
    1. QSslSocket *socket = new QSslSocket;
    To copy to clipboard, switch view to plain text mode 
    Last edited by Unplugged; 29th January 2008 at 09:19.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Static linking problems.

    Quote Originally Posted by Unplugged View Post
    Everything was ok with dynamic linking.
    As in with pre-built binary installation?

    Quote Originally Posted by Unplugged View Post
    My steps were: "configure -satic" and "mingw32-make" to rebuild Qt.
    Do you have OpenSSL installed? Notice such line in configure output:
    OpenSSL support.............<yes/no>
    J-P Nurmi

  3. #3
    Join Date
    Oct 2007
    Location
    Moscow, Russia
    Posts
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static linking problems.

    Quote Originally Posted by jpn View Post
    As in with pre-built binary installation?
    Yes.

    Quote Originally Posted by jpn View Post
    Do you have OpenSSL installed? Notice such line in configure output:
    I have OpenSSL installed, but configure output:
    OpenSSL support.............no

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Static linking problems.

    You will have to make it say "yes". Pass following parameters to configure (pointing to OpenSSL installation, of course):
    -I <includepath>
    -L <librarypath>
    -l <libraryname>
    See "configure -help" for more details.
    J-P Nurmi

  5. #5
    Join Date
    Oct 2007
    Location
    Moscow, Russia
    Posts
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static linking problems.

    I have OpenSSL 0.9.8g installed in "E:\Program Files\OpenSSl" , .h files are located in "E:\Program Files\OpenSSL\include\openssl", so includepath is
    -I E:\Program Files\OpenSSL\include\openssl
    .
    In lib directory there are three folders: Builder5, MiniGw and VC. How -L and -l have to look like?
    And do i have to rebuild Qt any time i am passing some parameters to configure?
    Last edited by Unplugged; 29th January 2008 at 09:51.

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Static linking problems.

    Well yes, configure is an utility which sets flags how Qt is built. But now that I re-look at configure -help, it might be enough to simply pass -openssl option. Could you try that?
    J-P Nurmi

  7. #7
    Join Date
    Oct 2007
    Location
    Moscow, Russia
    Posts
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static linking problems.

    I have passed -openssl to configure, the string in output changed to
    OpenSSL .....yes
    , then i typeb make sub-src, rebuilding started, and after a while i received a lot of errors about SSL. However, the problem I mentioned above disappeared, but there is another.
    cannot find -lQtNetworkd4
    It seems that debug library is missing.
    If I add
    CONFIG += release
    the program is compiling, but not as static, even if
    QMAKE_LFLAGS = -static
    added to project file.

  8. #8
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Static linking problems.

    Did you see this wiki article: [wiki]Building static applications[/wiki]?
    J-P Nurmi

  9. #9
    Join Date
    Jan 2008
    Posts
    27
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static linking problems.

    jpn: The wiki article states use using CONFIG += static in your pro file.

    A. This does not do anything for me.
    B. That option is not even supported by qmake. http://doc.trolltech.com/4.3/qmake-v...ce.html#config

    Here is what I have been doing. Any other ideas?

    Thanks.


    I have yet to be able to build my app statically. I am building qtopia-core-opensource-src-4.3.3 with configure:
    ./configure -static -embedded arm -xplatform qws/linux-arm-g++ -no-qvfb -depths 16 -no-largefile -no-accessibility -no-qt3support -no-gif -no-libjpeg -no-openssl -little-endian -no-libtiff -no-armfpa


    And my project file looks like this:
    Qt Code:
    1. TEMPLATE = app
    2. TARGET = Facebook
    3. QT += core \
    4. gui \
    5. xml
    6. HEADERS += TopBar.h \
    7. ProfileWin.h \
    8. NameDelegate.h \
    9. ClockWidget.h \
    10. MainWin.h \
    11. Recent.h \
    12. Settings.h
    13. SOURCES += main.cpp
    14. FORMS += TopBar.ui \
    15. ProfileWin.ui \
    16. MainWin.ui \
    17. Near.ui \
    18. Poke.ui \
    19. Recent.ui \
    20. Settings.ui \
    21. Syncing.ui
    22. RESOURCES +=
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 16
    Last Post: 23rd May 2008, 10:12
  2. Replies: 2
    Last Post: 4th December 2007, 00:34
  3. Replies: 2
    Last Post: 8th March 2007, 22:22
  4. I got two problems when I used static compiled library of QT4
    By qintm in forum Installation and Deployment
    Replies: 8
    Last Post: 20th April 2006, 08:52
  5. Replies: 4
    Last Post: 20th February 2006, 09:11

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.