Results 1 to 15 of 15

Thread: What other libs to link with Libpq in Ubuntu?

  1. #1
    Join Date
    Nov 2009
    Location
    Laval, France
    Posts
    124
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default What other libs to link with Libpq in Ubuntu?

    Hi,
    Just started testing the latest Ubuntu.
    I'd like to port an app I wrote that is sort of working in Windows, using Libpq
    because I gave up long ago trying to make a driver to Postgrees. It's too late to change now (at least for a while, I dont have the time).

    Has anyone written an app to run with Libpq?
    In my windows file Libs += ...\Libpq.a
    works fine
    but in Ubuntu I get hundreds of undefined symbols.

    thankyou
    Henri

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: What other libs to link with Libpq in Ubuntu?

    Quote Originally Posted by feraudyh View Post
    In my windows file Libs += ...\Libpq.a works fine
    If you mean the operating system Windows, then I seriously doubt that line works!

  3. #3
    Join Date
    Nov 2009
    Location
    Laval, France
    Posts
    124
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: What other libs to link with Libpq in Ubuntu?

    yeah, right, I got the wrong extension, I meant libpq.lib.
    here's the bottom of my qmake file:
    win32 {
    LIBS += "C:\Progra~1\PostgreSQL\8.4\lib\libpq.lib"
    INCLUDEPATH += "C:\Progra~1\PostgreSQL\8.4\include"
    }
    linux-g++ {
    LIBS += /usr/lib/libpq.a
    INCLUDEPATH += /usr/include/postgresql
    }
    Last edited by feraudyh; 21st September 2010 at 17:16. Reason: English, details

  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: What other libs to link with Libpq in Ubuntu?

    Are you using a static postgresql library?
    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.


  5. #5
    Join Date
    Nov 2009
    Location
    Laval, France
    Posts
    124
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: What other libs to link with Libpq in Ubuntu?

    To be honest I dont know. I just use the defaults and a qmake file that ends like above.
    How can I find out if it's static?
    I think the extension really is ".a". Doesnt that tell you?
    If I could solve my problem by moving to a non-static library I would.

  6. #6
    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: What other libs to link with Libpq in Ubuntu?

    You should be aware of the tools you are using. Use of static libraries is completely different than use of dynamic ones so first decide whether you want to use statically or dynamically linked libs and only then actually start trying to use them. Licencing issues are a concern here as well.
    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.


  7. #7
    Join Date
    Nov 2009
    Location
    Laval, France
    Posts
    124
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: What other libs to link with Libpq in Ubuntu?

    We're getting off the subject.

  8. #8
    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: What other libs to link with Libpq in Ubuntu?

    No, we are not. The dynamic version of libpq requires the following libraries:
    text Code:
    1. linux-gate.so.1 => (0xffffe000)
    2. libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0xb76ba000)
    3. libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0xb74f9000)
    4. libcrypt.so.1 => /lib/libcrypt.so.1 (0xb74b0000)
    5. libc.so.6 => /lib/i686/libc.so.6 (0xb735e000)
    6. libdl.so.2 => /lib/libdl.so.2 (0xb7359000)
    7. libpthread.so.0 => /lib/i686/libpthread.so.0 (0xb7341000)
    8. /lib/ld-linux.so.2 (0xb776a000)
    To copy to clipboard, switch view to plain text mode 

    The static one requires all undefined symbols to be defined. You can use nm and grep to see what they 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.


  9. #9
    Join Date
    Nov 2009
    Location
    Laval, France
    Posts
    124
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: What other libs to link with Libpq in Ubuntu?

    Well, if there are two choices it's not hard to give an answer as you have indeed shown.
    So grep is used in this case to look inside binaries, right?

    Now I dont know if the dynamic libraries involve the same licencing conditions, or more to the point, where can I find out for this case?

    Thanks.
    Last edited by feraudyh; 22nd September 2010 at 14:59.

  10. #10
    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: What other libs to link with Libpq in Ubuntu?

    Quote Originally Posted by feraudyh View Post
    So grep is used in this case to look inside binaries, right?
    No, it's used to filter out results of nm.

    Now I dont know if the dynamic libraries involve the same licencing conditions, or more to the point, where can I find out for this case?
    As far as I remember PostgreSQL is LGPL which means that if you are writing a closed-source application, you can't link it statically. But feel free to check it on PostgreSQL website.
    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.


  11. #11
    Join Date
    Nov 2009
    Location
    Laval, France
    Posts
    124
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: What other libs to link with Libpq in Ubuntu?

    Wow, the difference between linking statically and dynamically really seems like splitting hairs, but I will look up the postgres site.
    You have given me very useful advice.

  12. #12
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: What other libs to link with Libpq in Ubuntu?

    Quote Originally Posted by feraudyh View Post
    Wow, the difference between linking statically and dynamically really seems like splitting hairs
    If you are talking about the licences, then no, this is not splitting hairs.
    In one case you only link (read: include) your own code, in the other case you link (read: include) the code of someone else.
    In the professional world this is a huge difference.

  13. #13
    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: What other libs to link with Libpq in Ubuntu?

    It's also a difference when it comes to deploying your program. Either you need to deploy the library with your program (when linking dynamically) or not (when linking statically) at a cost of increased binary size.
    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.


  14. #14
    Join Date
    Nov 2009
    Location
    Laval, France
    Posts
    124
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: What other libs to link with Libpq in Ubuntu?

    I get it, when you are deploying the library, someone else can start developing with it too, if he has the documentation.

  15. #15
    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: What other libs to link with Libpq in Ubuntu?

    Quote Originally Posted by feraudyh View Post
    I get it, when you are deploying the library, someone else can start developing with it too, if he has the documentation.
    No, that's not what we meant.
    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. Static Link 3rd party libs
    By ^NyAw^ in forum General Programming
    Replies: 1
    Last Post: 13th July 2010, 20:10
  2. Replies: 3
    Last Post: 18th February 2010, 17:43
  3. Link all Qt libs statically.
    By psih128 in forum Installation and Deployment
    Replies: 12
    Last Post: 29th December 2008, 21:48
  4. Burn libs
    By Elgrimm Esleborn in forum General Programming
    Replies: 2
    Last Post: 16th March 2006, 16:12
  5. use libs under qt4
    By raphaelf in forum Qt Programming
    Replies: 6
    Last Post: 27th February 2006, 18:59

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.