Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Static build for SQL plugin
Forum Updated to NodeBB v4.3 + New Features

Static build for SQL plugin

Scheduled Pinned Locked Moved General and Desktop
69 Posts 3 Posters 41.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #60

    You won't have any plugin lib since they are built in Qt's sql library, did you add qsqlpsql in your pro file ?

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mbnoimi
      wrote on last edited by
      #61

      [quote author="SGaist" date="1380487767"]You won't have any plugin lib since they are built in Qt's sql library, did you add qsqlpsql in your pro file ?[/quote]

      test.pro
      [code]QT += core gui sql

      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

      TARGET = test
      TEMPLATE = app

      SOURCES += main.cpp
      mainwindow.cpp

      HEADERS += mainwindow.h

      FORMS += mainwindow.ui

      QTPLUGIN += qsqlpsql

      QMAKE_LFLAGS += -static -static-libgcc -static-libstdc++ -lpthread

      LIBS += -LC:/postgresql-9.1.9/src/interfaces/libpq -lpq
      [/code]

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mbnoimi
        wrote on last edited by
        #62

        main.cpp
        [code]#include "mainwindow.h"
        #include <QApplication>
        #include <QtPlugin>

        Q_IMPORT_PLUGIN( qsqlpsql )

        int main(int argc, char *argv[])
        {

        QApplication a(argc, argv);
        MainWindow w;
        w.show();
        
        return a.exec&#40;&#41;;
        

        }
        [/code]

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #63

          Just thought that since you have all sql plugins built in you might not need the QTPLUGIN line from the pro file

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mbnoimi
            wrote on last edited by
            #64

            [quote author="SGaist" date="1380528900"]Just thought that since you have all sql plugins built in you might not need the QTPLUGIN line from the pro file[/quote]

            Unfortunately it didn't fix the issue and generated ton of errors as shown in full log of build process: http://paste.kde.org/p96ac01e7

            I'm really frustrated; The hardest step done (building Postgresql with MinGW) while the supposed easy one delays the success!!!

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #65

              Looks like it needs postgresql symbol, you have to add the link information to postgresql

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mbnoimi
                wrote on last edited by
                #66

                [quote author="SGaist" date="1380785713"]Looks like it needs postgresql symbol, you have to add the link information to postgresql[/quote]

                How can I do it?

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #67

                  Add the same -l and -L to LIBS that you used to build Qt with postgresql

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    mbnoimi
                    wrote on last edited by
                    #68

                    [quote author="SGaist" date="1380805190"]Add the same -l and -L to LIBS that you used to build Qt with postgresql[/quote]

                    I already added them as mentioned in "a reply before":https://qt-project.org/forums/viewreply/144622/.

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mbnoimi
                      wrote on last edited by
                      #69

                      Is there any new idea guys? The recent result I got was:
                      https://qt-project.org/forums/viewreply/144622/
                      https://qt-project.org/forums/viewreply/144623/

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved