You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the following process, which successfully compiles (and runs) foo.cpp against the shared lib version as of svn trunk 1945 but fails when using the latest github master
git clone https://github.com/jtv/libpqxx
cd libpqxx
CXXFLAGS="-std=c++11 -DPQXX_SHARED -g" ./configure --disable-documentation --enable-shared=yes --enable-static=no --prefix=$HOME/local
make
make install
cd ~/pqxx_foo_test
g++ foo.cpp -v -o foo -std=c++11 -I$HOME/local/include -L$HOME/local/lib -DPQXX_SHARED -lpqxx -lpq && ./foo
the build of libpqxx completes successfully but in the last step, where I compile foo.cpp using g++ compilation succeeds but linking fails with the following error
In function `pqxx::result::make_data_pointer(pg_result const*)': /home/me/local/include/pqxx/result.hxx:203: undefined reference to `pqxx::internal::clear_result(pg_result const*)'
NOTE: it appears that -DPQXX_SHARED is not required on linux because compiling svn trunk and compiling my example foo.cpp against the shared svn trunk works with or without this flag. reading the docs, it is not clear to me whether this directive is required on windows only, or at all, I am including it when building both svn trunk and github master, nothing appears to change if I leave it out
my gcc version information
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
compiling github master statically and linking foo.cpp to libpqxx statically succeeds
The text was updated successfully, but these errors were encountered:
rocksolidwebdesign
changed the title
cannot compile against shared libs
linking to shared lib fails on github master but succeeds on svn trunk
Oct 8, 2017
here is the example test case C++ source code I'm using for
foo.cpp
I'm using the following process, which successfully compiles (and runs)
foo.cpp
against the shared lib version as of svn trunk 1945 but fails when using the latest github masterthe build of libpqxx completes successfully but in the last step, where I compile
foo.cpp
usingg++
compilation succeeds but linking fails with the following errorNOTE: it appears that
-DPQXX_SHARED
is not required on linux because compiling svn trunk and compiling my example foo.cpp against the shared svn trunk works with or without this flag. reading the docs, it is not clear to me whether this directive is required on windows only, or at all, I am including it when building both svn trunk and github master, nothing appears to change if I leave it outmy gcc version information
compiling github master statically and linking foo.cpp to libpqxx statically succeeds
The text was updated successfully, but these errors were encountered: