Results 1 to 20 of 38

Thread: How to add a lib to a qt project

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2011
    Posts
    26
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to add a lib to a qt project

    Hey Chris,
    thanks for helping me again.

    I followed your detailed instructions.
    The differences to my last try is, this time I used "Qt command prompt". Last time it was "Windows command prompt". And there was a blank in the installation path of postgresql. I elliminated the blank for plugin building now.

    There were no error messages while building the plugin now.

    But I haven't understood what to do now to use the plugin.

  2. #2
    Join Date
    Feb 2011
    Posts
    26
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to add a lib to a qt project

    Okay,
    Here in Qt Centre I found this wiki article:
    http://www.qtcentre.org/wiki/index.p...ws_using_MinGW

    When I compare what I've done with this article, I find the files "qsqlpsql4.dll" and "qsqlpsqld4.dll" in the folder "%QTDIR%\plugins\sqldrivers".

    If I load the "qsqlpsql4.dll" with the dependency walker I get the information that there are a few files missing (libpq.dll, mingwm10.dll, libgcc_s_dw2-1.dll, qtcore4.dll, qtsql4.dll).

    Tomorrow I'll try to update my enviromental variable paths.
    Please tell me if I'm completly wrong.

    Greetings

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to add a lib to a qt project

    Lot to learn you still have, young padawan. However on the right path you are.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    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: How to add a lib to a qt project

    Quote Originally Posted by WilliamSpiderWeb View Post
    Okay,
    If I load the "qsqlpsql4.dll" with the dependency walker I get the information that there are a few files missing (libpq.dll, mingwm10.dll, libgcc_s_dw2-1.dll, qtcore4.dll, qtsql4.dll).
    When you started Dependency Walker it was given the default Windows environment PATH, which does not include the Qt bin directories that contain all of the Qt and MingW files listed there. The default environment PATH also does not contain the PostgreSQL binary directory for the PostgreSQL library. Consequently, the Dependency Walker could not load any of these DLLs. If you had launched the Dependency Walker from the "Qt Command Prompt" most of the libraries, except the Postgres ones, would have been found.

    You should add the PostgreSQL bin directory to your system PATH. If you develop your program in an environment with the Qt paths set properly such as the Qt Command Prompt or Qt Creator then you should not need to add QT or MingW stuff to the system path. When you deploy you will need to ship the MingW, PostgreSQL and Qt libraries with your application.

  5. #5
    Join Date
    Feb 2011
    Posts
    26
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to add a lib to a qt project

    Now I added the following paths to the enviroment variable path
    C:\psql9\bin
    C:\qt\2010.05\bin
    C:\qt\2010.05\qt\bin
    C:\qt\2010.05\mingw\bin
    But then there are more and more dlls the dependency walker cannot found or with other errors
    Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
    Error: Modules with different CPU types were found.

  6. #6
    Join Date
    Feb 2011
    Posts
    26
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to add a lib to a qt project

    Just to inform other Newbies who want to connect to PostgreSQL databases as well...

    My last-ditch attempt was, just don't care about what the results of the dependency walker are and copied ALL dlls of %postgresdir%\bin.

    Now I can load the QPSQL Driver and connect to my postgresql database.

    At this point I want to thank the experts of this forum again for trying to help me.


    Greetz, wsw
    Last edited by WilliamSpiderWeb; 19th March 2011 at 00:09.

Similar Threads

  1. Qt project management - bigger project
    By Peppy in forum Qt Programming
    Replies: 11
    Last Post: 24th December 2010, 13:50
  2. How to add a gif to a Qt Project?
    By Bong.Da.City in forum Newbie
    Replies: 5
    Last Post: 6th September 2010, 21:51
  3. new project
    By rk0747 in forum Qt Programming
    Replies: 5
    Last Post: 17th February 2010, 08:53
  4. Replies: 1
    Last Post: 3rd December 2009, 23:34
  5. Project generation on linux from QT Project
    By darpan in forum Qt Programming
    Replies: 6
    Last Post: 11th December 2006, 09:43

Tags for this Thread

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.