Results 1 to 2 of 2

Thread: Static compile and SQL

  1. #1
    Join Date
    Aug 2010
    Location
    Poland
    Posts
    19
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Static compile and SQL

    Hi all. I have problem with my application. I built static application like in this video-tutorial, but suddenly SQL support in my application stopped working. I don't have any ideas what happened bad. Maybe I must compile that again with another parameters? If so, then what?

    My *.pro file, is this good?
    Qt Code:
    1. QT += core gui sql
    2.  
    3. CONFIG += libqsqlmysql4
    4. CONFIG += libqsqlmysqld4
    5. CONFIG += static
    6.  
    7. TARGET = game-launcher
    8. TEMPLATE = app
    9.  
    10.  
    11. SOURCES += main.cpp\
    12. mainwindow.cpp \
    13. login.cpp
    14.  
    15. HEADERS += mainwindow.h \
    16. login.h
    17.  
    18. FORMS += mainwindow.ui \
    19. login.ui
    20.  
    21. RESOURCES += \
    22. zasoby.qrc
    23.  
    24. RC_FILE = settings.cfg
    To copy to clipboard, switch view to plain text mode 

    Sorry for my bad english.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Static compile and SQL

    Qt SQL functionality is implemented using plugins. Statically linked Qt cannot use dynamically loaded plugins so any require plugins must be built-in and explicitly loaded.
    Static Plugins

    Lines 3 and 4 of your PRO file don't make much sense.
    You are missing the QTPLUGIN variable
    You are probably missing the Q_IMPORT_PLUGIN() macro in your code

    You will still need to deploy any database engine library your SQL support requires.

Similar Threads

  1. OpenGl compile static
    By vicbr in forum Newbie
    Replies: 0
    Last Post: 18th August 2011, 23:49
  2. Problems with static compile for QextSerialPort
    By blm in forum Qt Programming
    Replies: 4
    Last Post: 6th October 2009, 12:55
  3. Static compile with jpg support
    By ksqt in forum Newbie
    Replies: 18
    Last Post: 11th May 2007, 04:43
  4. Static Compile [Qt4]
    By PieaholicX in forum Newbie
    Replies: 11
    Last Post: 1st September 2006, 17:18
  5. static compile in qt4 with VisualStudio2003
    By iGoo in forum Installation and Deployment
    Replies: 1
    Last Post: 21st July 2006, 08:46

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
  •  
Qt is a trademark of The Qt Company.