View previous topic :: View next topic |
Author |
Message |
sevilla.larry n00b
Joined: 09 Nov 2015 Posts: 42
|
Posted: Thu Oct 14, 2021 11:06 am Post subject: PostgreSQL, C++, libpqxx - compiling error |
|
|
I'm new to C++ to PostgreSQL interface using libpqxx.
And not sure if this is the right forum.
My guide is: https://www.tutorialspoint.com/postgresql/postgresql_c_cpp.htm
I have the ff emerged/installed:
1. GCC 11.2.0
2. PostgreSQL 13.3 (USE -server static-libs) - client libraries only
Note: server is on another PC
3. libpqxx 7.2.1
Source Code: https://pastebin.com/jHrRizAf
Compile: g++ -I /usr/include/pqxx/ -L /usr/lib64/ -I /usr/include/postgresql/ -L /usr/lib64/postgresql/ testPGcli.cpp -lpqxx -lpq
ErrorMsg: https://pastebin.com/MrjT9MHH |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Thu Oct 14, 2021 12:44 pm Post subject: |
|
|
If I use the command you posted,
Code: | g++ -I /usr/include/pqxx/ -L /usr/lib64/ -I /usr/include/postgresql/ -L /usr/lib64/postgresql/ testPGcli.cpp -lpqxx -lpq |
g++ emits the error messages you posted.
It works if I use
Code: | g++ testPGcli.cpp -lpqxx -lpq |
Don't ask me why...
Please note that the examples on the tutorialpoint page are probably outdated. The tutorial was written for libpqxx-4.0. |
|
Back to top |
|
|
sevilla.larry n00b
Joined: 09 Nov 2015 Posts: 42
|
Posted: Thu Oct 14, 2021 2:34 pm Post subject: |
|
|
thx...
was just following the guide ... |
|
Back to top |
|
|
|