Page 2 of 2 FirstFirst 12
Results 21 to 29 of 29

Thread: Access to PostgreSQL DB on a linux server

  1. #21
    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: Access to PostgreSQL DB on a linux server

    Quote Originally Posted by gQt View Post
    That's the strange thing, I downloaded the qt-x11-commercial-src-4.3.3.tar.gz and this file should also be a source package, but I could remove the installation and install the opensource version instead.
    Sorry, is this ... a question?
    J-P Nurmi

  2. #22
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    4

    Default Re: Access to PostgreSQL DB on a linux server

    Hi,

    The src-dir wasn't installed for some reason so I will copy the src-dir from the tar.gz-file to QtDir.

  3. #23
    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: Access to PostgreSQL DB on a linux server

    What? Wait! "make install" doesn't install sources. You are supposed to reconfigure Qt and/or rebuild Qt or its plugins in the original source directory. That's where you compiled Qt in the first place.
    J-P Nurmi

  4. #24
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    4

    Default Re: Access to PostgreSQL DB on a linux server

    Hi,
    Thanks!

    I had to copy the srcdir from the .tar.gz file, for som reason the srcdir was not installed. qmake detect all the files:
    qmake -o Makefile "INCLUDEPATH+=/usr/include/pgsql" "LIBS+=-L/usr/lib -lpq" psql.pro

    But make gives a lot of errors and can't find libpq-fe.h. (This file is no where, tried locate). The errors in qsql_psql.cpp is probably because libpq-fe.h is missing.

    the postgresql-client-8.1, postgresql-dev and postgresql-server-dev-8.1 is installed

    I tried also to reconfigure qt. (make confclean first) and then
    ./configure -qt-sql-psql -plugin-sql-psql

  5. #25
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    4

    Default Re: Access to PostgreSQL DB on a linux server

    Hi,

    Finally make worked: qmake -o Makefile "INCLUDEPATH+=/usr/include/postgresql" "LIBS+=-L/usr/lib -lpq" psql.pro

    The INCLUDEPATH had to be set to /usr/include/postgresql not /usr/include/pgsql

    I still get the same errors when trying to run the database example. I have placed the libqsqlpsql.so in the folder you suggsted erlier, but I have no libqsqlpsql.so.debug file.

    I guess I need this file, libqsqlpsql.so.debug, also?
    Last edited by gQt; 12th March 2008 at 13:15.

  6. #26
    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: Access to PostgreSQL DB on a linux server

    Quote Originally Posted by gQt View Post
    Finally make worked: qmake -o Makefile "INCLUDEPATH+=/usr/include/postgresql" "LIBS+=-L/usr/lib -lpq" psql.pro

    The INCLUDEPATH had to be set to /usr/include/postgresql not /usr/include/pgsql
    Naturally if that's where your distribution installs them.

    I still get the same errors when trying to run the database example. I have placed the libqsqlpsql.so in the folder you suggsted erlier, but I have no libqsqlpsql.so.debug file.
    Just to assure, what does "ldd libqsqlpsql.so" output?
    J-P Nurmi

  7. #27
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    4

    Default Re: Access to PostgreSQL DB on a linux server

    Thanks again jpn!

    Maybe I have placed the file in the wrong dir?
    I' m a little confused by this, I don't have a sqldrivers-subdir under bin if that what you mean?

    Quote Originally Posted by jpn View Post
    You can always place the plugin into sqldrivers-subdir of the application binary.
    /path/to/app/binary
    /path/to/app/sqldrivers/libqsqlpsql.so
    debian:/usr/local/Trolltech/Qt-4.3.3/bin# ls
    assistant linguist.debug moc qt3to4 qtdemo.debug uic3.debug
    assistant.debug lrelease moc.debug qt3to4.debug rcc uic.debug
    designer lrelease.debug pixeltool qtconfig rcc.debug
    designer.debug lupdate pixeltool.debug qtconfig.debug uic
    linguist lupdate.debug qmake qtdemo uic3
    libqsqlpsql.so is placed in this dir:

    debian:/usr/local/Trolltech/Qt-4.3.3/sql/drivers# ldd libqsqlpsql.so
    linux-gate.so.1 => (0xffffe000)
    libpq.so.4 => /usr/lib/libpq.so.4 (0xb7eda000)
    libQtSql.so.4 => /usr/local/Trolltech/Qt-4.3.3/lib/libQtSql.so.4 (0xb7ea2000)
    libQtCore.so.4 => /usr/local/Trolltech/Qt-4.3.3/lib/libQtCore.so.4 (0xb7cfe000)
    libz.so.1 => /usr/lib/libz.so.1 (0xb7cea000)
    libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb7ce6000)
    libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb7c54000)
    librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb7c4a000)
    libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7c46000)
    libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7c34000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7b4f000)
    libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7b2a000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7b1f000)
    libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb79ed000)
    libssl.so.0.9.8 => /usr/lib/i686/cmov/libssl.so.0.9.8 (0xb79ae000)
    libcrypto.so.0.9.8 => /usr/lib/i686/cmov/libcrypto.so.0.9.8 (0xb7874000)
    libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0xb77f8000)
    libcom_err.so.2 => /lib/libcom_err.so.2 (0xb77f5000)
    libcrypt.so.1 => /lib/tls/i686/cmov/libcrypt.so.1 (0xb77c7000)
    /lib/ld-linux.so.2 (0x80000000)
    libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0xb77a1000)
    libresolv.so.2 => /lib/tls/i686/cmov/libresolv.so.2 (0xb778e000)
    libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0xb7789000)
    Last edited by jpn; 13th March 2008 at 08:47. Reason: missing [quote] tags

  8. #28
    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: Access to PostgreSQL DB on a linux server

    Yes, that's incorrect path. You shouldn't be creating any directories under /usr/local/Trolltech/Qt-4.x.y on your own. The proper directory is already there. You should place the plugin in
    /usr/local/Trolltech/Qt-4.3.3/plugins/sqldrivers/libqsqlpsql.so
    I believe invoking "make install" where you built the plugin should've been enough.
    J-P Nurmi

  9. #29
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    4

    Default Re: Access to PostgreSQL DB on a linux server

    That helped a lot
    Thanks !!

Similar Threads

  1. Replies: 0
    Last Post: 16th April 2007, 12:18
  2. Replies: 1
    Last Post: 4th October 2006, 16:05
  3. Access MS .mdb file on Linux
    By iGoo in forum Qt Programming
    Replies: 3
    Last Post: 15th June 2006, 09:42

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.