Results 1 to 4 of 4

Thread: cross compiling with linux to create a windows app, cant get libpq to link

  1. #1
    Join Date
    Jul 2010
    Posts
    16
    Qt products
    Qt4
    Platforms
    Unix/X11 Maemo/MeeGo

    Default cross compiling with linux to create a windows app, cant get libpq to link

    Hi folks
    Im using the latest qt and im able to create linux apps and cross compile windows apps on a linux ubuntu system. But now i need my windows app to access a postgresql database that is running on an external linux box. so i added the following to my .pro file

    unix:LIBS += -lpq
    win32:LIBS += libpqdll.lib

    a database connection works ok when compiling for linux but im getting this error when i compile the app for windows.

    /usr/lib/gcc/i586-mingw32msvc/4.4.2/../../../../i586-mingw32msvc/bin/ld: cannot find -lpqdll.lib

    I know i probably have to download the lib or build the lib from source. Where would i find this library? or do i search for it on the mingw site and just download it and place it in the proper location? Any help would be appreciated. Thanks

  2. #2
    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: cross compiling with linux to create a windows app, cant get libpq to link

    Why don't you use Qt's database plugins? You wouldn't need to link against libpq directly.
    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.


  3. #3
    Join Date
    Jul 2010
    Posts
    16
    Qt products
    Qt4
    Platforms
    Unix/X11 Maemo/MeeGo

    Default Re: cross compiling with linux to create a windows app, cant get libpq to link

    Yeah i was doing that earlier and i didnt have any of the unix:LIBS += -lpq or win32:LIBS += libpqdll.lib defined in the .pro file and the linux app was connecting just fine because i did have QT += sql, so this means the windows side of things when doing this make distclean && qmake -spec win32-x-g++ && make will connect as well? I tried building the app again for windows without any of the LIBS defined and it doesnt connect to postgres but the linux app does? Do i need a different sql flag of some sort for mingw?


    Added after 7 minutes:


    I think need some database plugins on my windows side of qt4.7-mingw directory for now ive been just placing my binaries in the c:\qt-4.7-mingw\4.7.1\bin path and they have been running fine there until im ready to learn how to package this stuff up. I see database dlls in the plugins dir but not one for postgresql .
    Last edited by newbie43; 18th December 2010 at 16:11.

  4. #4
    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: cross compiling with linux to create a windows app, cant get libpq to link

    Yes, you need a Qt PostgreSQL plugin for Windows.
    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.


Similar Threads

  1. What other libs to link with Libpq in Ubuntu?
    By feraudyh in forum Installation and Deployment
    Replies: 14
    Last Post: 23rd September 2010, 07:30
  2. Cross compiling Qt 4 apps for linux
    By Dante in forum Qt Programming
    Replies: 9
    Last Post: 13th May 2009, 13:33
  3. Cross-Compiling Linux to Windows
    By xgoan in forum Qt Programming
    Replies: 10
    Last Post: 5th July 2007, 20:44
  4. link error when cross-compiling qtopia 4.2.0
    By ghellman in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 9th February 2007, 04:13
  5. Cross compiling QT3 on Linux, for win32
    By mjrich in forum Installation and Deployment
    Replies: 10
    Last Post: 6th March 2006, 18:58

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.