-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Having trouble linking on RHEL 8.6 #608
Comments
It looks like pqxx is not linked by |
That is an old libpqxx version indeed. Off the top of my head, I'd guess it was 6.x at the latest, compiling with C++11 or older. Just as a suggestion, there may be a backported version of gcc — although of course your customer may have rules that prohibit backports. As @tt4g said, you don't seem to be linking in libpqxx at all! Link On a side note... Don't include |
@argo1221 does this solve your problem? |
There has been no activity on this ticket. Consider closing it. |
OK, OK, we'll close it then. |
I am trying to compile and link this older version, because our customer is using a version of RHEL that uses an older gcc.
Here are my includes:
#include <libpq-fe.h>
#include <pqxx/pqxx>
Here is the code. This was put in as a placeholder just to get thing up and running:
pqxx::connection c("dbname=onc user=postgres hostaddr=10.17.12.69 port=5432");
//pqxx::work w(c);
I am eventually going to connect to a different IP address and modify an existing table.
This is what happens when I try to build it.
oceus/OCEUS_OSUtils.o: In function
pqxx::basic_connection_base<pqxx::connect_direct>::~basic_connection_base()': OCEUS_OSUtils.cpp:(.text._ZN4pqxx21basic_connection_baseINS_14connect_directEED2Ev[_ZN4pqxx21basic_connection_baseINS_14connect_directEED2Ev]+0x15): undefined reference to
pqxx::connection_base::close()'oceus/OCEUS_OSUtils.o: In function
pqxx::basic_connection_base<pqxx::connect_direct>::basic_connection_base(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': OCEUS_OSUtils.cpp:(.text._ZN4pqxx21basic_connection_baseINS_14connect_directEEC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4pqxx21basic_connection_baseINS_14connect_directEEC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x6c): undefined reference to
pqxx::connection_base::init()'oceus/OCEUS_OSUtils.o: In function
pqxx::connection_base::connection_base(pqxx::connectionpolicy&)': OCEUS_OSUtils.cpp:(.text._ZN4pqxx15connection_baseC2ERNS_16connectionpolicyE[_ZN4pqxx15connection_baseC2ERNS_16connectionpolicyE]+0xf5): undefined reference to
int pqxx::internal::check_library_version<6, 4>()'OCEUS_OSUtils.cpp:(.text._ZN4pqxx15connection_baseC2ERNS_16connectionpolicyE[_ZN4pqxx15connection_baseC2ERNS_16connectionpolicyE]+0x128): undefined reference to
pqxx::connection_base::clearcaps()' oceus/OCEUS_OSUtils.o: In function
pqxx::connect_direct::connect_direct(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)':OCEUS_OSUtils.cpp:(.text._ZN4pqxx14connect_directC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4pqxx14connect_directC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x1d): undefined reference to
pqxx::connectionpolicy::connectionpolicy(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' OCEUS_OSUtils.cpp:(.text._ZN4pqxx14connect_directC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4pqxx14connect_directC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x28): undefined reference to
vtable for pqxx::connect_direct'oceus/OCEUS_OSUtils.o: In function
pqxx::connect_direct::~connect_direct()': OCEUS_OSUtils.cpp:(.text._ZN4pqxx14connect_directD2Ev[_ZN4pqxx14connect_directD2Ev]+0x11): undefined reference to
pqxx::connectionpolicy::~connectionpolicy()'clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [make-linux.mk:350: one] Error 1
make[1]: Leaving directory '/Projects/oncast_sandbox/zerotierone'
make: *** [make-linux.mk:392: central-controller] Error 2
make: Leaving directory '/Projects/oncast_sandbox/zerotierone'
Here is the relevant section of the makefile:
central-controller: FORCE
make -j4 LDLIBS="-L/usr/local/pgsql/lib/ -lpq -L/usr/local/lib/ -Lext/librabbitmq/centos_x64/lib/ -lrabbitmq" CXXFLAGS="-I/usr/local/pgsql/include -I./ext/librabbitmq/centos_x64/include -fPIC" DEFS="-DZT_CONTROLLER_USE_LIBPQ -DZT_CONTROLLER" ZT_OFFICIAL=1 ZT_USE_X64_ASM_ED25519=1 one
I have built postgresql 10.22 from source, as well as libpqxx.
The libpxx libraries are installed at /usr/local/lib.
If you have any clues as to what is going on I would appreciate it.
Thanks!!
The text was updated successfully, but these errors were encountered: