Giter Site home page Giter Site logo

Comments (10)

jtv avatar jtv commented on June 2, 2024

@ldpl what compile options did you use for compiling libpqxx?

from libpqxx.

jtv avatar jtv commented on June 2, 2024

This appears to be a duplicate of #820 and #822, but we never got to the bottom of those. :-(

In this case though, your link options seem to be in the wrong order. You did -lpq -lpqxx but the proper order is -lpqxx -lpq.

from libpqxx.

ldpl avatar ldpl commented on June 2, 2024

I tried compiling with no options, tried with ./configure --disable-shared as in documentation, tried different combinations like ./configure --enable-shared --prefix=/usr CXXFLAGS="-std=c++17", nothing makes any difference.
Swapping -lpqxx and -lpq changes nothing as well.

from libpqxx.

jtv avatar jtv commented on June 2, 2024

Thanks @ldpl, that tells us a few things about what the problem isn't. Unfortunately at this point we're left with a mystery, so we'll have to go through the possibilities.

Here's a very basic one: What happens if, on the command line where you compile & link your own application, you put the -lpqxx -lpq part after the name of your source file?

So: g++ example.cpp -lpq -lpqxx

from libpqxx.

ldpl avatar ldpl commented on June 2, 2024

So: g++ example.cpp -lpq -lpqxx

No idea why but that compiles just fine.

UPD. And so does g++ -fPIC -shared -lpq -lpqxx example.cpp
UPD2. Actually, g++ example.cpp -lpqxx -lpq compiles, not g++ example.cpp -lpq -lpqxx

from libpqxx.

tt4g avatar tt4g commented on June 2, 2024

This may be due to gcc's behavior.
I found a detailed explanation on Stack Overflow: https://stackoverflow.com/a/409402

from libpqxx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.