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. QSqlDatabase: QPSQL driver not loaded - linux ubuntu
Forum Updated to NodeBB v4.3 + New Features

QSqlDatabase: QPSQL driver not loaded - linux ubuntu

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 3.8k 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.
  • E Offline
    E Offline
    ellorenz
    wrote on 2 Apr 2021, 14:36 last edited by
    #1

    Hi to all
    I built a new ubuntu 18.04 virtual machine,
    i have installed
    apt-get install postgresql
    apt-get install postgresql
    apt-get install libpq-dev
    apt-get install libpq-dev python-dev
    sudo apt-get install libqt5sql5-psql
    apt-get install postgresql-client
    From repositories was installed the version of postgres
    Then i installed qt from online installer and i using 5.15.2 version
    QSqlDriver give message QPSQL is present but give me the message Driver not load.
    This is installation is on hyper-v virtual machine
    another installation on vmware machine tries to load the library with -avx2 postfix and gives me the same error

    There is anyone can help me?

    J 1 Reply Last reply 2 Apr 2021, 14:39
    0
    • E ellorenz
      2 Apr 2021, 14:36

      Hi to all
      I built a new ubuntu 18.04 virtual machine,
      i have installed
      apt-get install postgresql
      apt-get install postgresql
      apt-get install libpq-dev
      apt-get install libpq-dev python-dev
      sudo apt-get install libqt5sql5-psql
      apt-get install postgresql-client
      From repositories was installed the version of postgres
      Then i installed qt from online installer and i using 5.15.2 version
      QSqlDriver give message QPSQL is present but give me the message Driver not load.
      This is installation is on hyper-v virtual machine
      another installation on vmware machine tries to load the library with -avx2 postfix and gives me the same error

      There is anyone can help me?

      J Offline
      J Offline
      JonB
      wrote on 2 Apr 2021, 14:39 last edited by JonB 4 Feb 2021, 14:39
      #2

      @ellorenz
      Always the same answer for this question: you need to set environment variable export QT_DEBUG_PLUGINS=1 and run your application, it will send diagnostic output to stdout/stderr, you usually need to look at the end of it to see what's failing.

      E 1 Reply Last reply 2 Apr 2021, 20:38
      0
      • J JonB
        2 Apr 2021, 14:39

        @ellorenz
        Always the same answer for this question: you need to set environment variable export QT_DEBUG_PLUGINS=1 and run your application, it will send diagnostic output to stdout/stderr, you usually need to look at the end of it to see what's failing.

        E Offline
        E Offline
        ellorenz
        wrote on 2 Apr 2021, 20:38 last edited by
        #3

        @JonB Found the problem sorry

        If you declare

        QSqlDatabase database
        database.addDatabase("QPSQL");

        instead of
        QSqlDatabase database = QSqlDatabase::addDatabase("QPSQL");

        It lost drivers pointer at open function

        1 Reply Last reply
        0

        1/3

        2 Apr 2021, 14:36

        • Login

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