compiling libpqxx project error

Hi,

Via the ports tree, I installed the following:
Code:
postgresql-libpqxx 4.0
postgresql84-client 8.4

Test code:
Code:
#include <iostream>
#include <pqxx/pqxx>

using namespace pqxx;
using namespace std;

int main(){

  connection c;

}

Compile command:
Code:
g++ sqlTest.cpp -o sqlT -I /usr/local/include -lpqxx -lpq

Error generated
Code:
/usr/bin/ld: cannot find -lpqxx

Any suggestions why are these files not in that folder after installation? Any solutions?

If I tried:
Code:
g++ sqlTest.cpp -o sqlT -I /usr/local/include

Error generated:
Code:
/var/tmp//ccNEqfUu.o: In function `pqxx::connect_direct::connect_direct(std::string const&)':
proj.cpp:(.text._ZN4pqxx14connect_directC1ERKSs[_ZN4pqxx14connect_directC1ERKSs]+0x19): undefined
 reference to `pqxx::connectionpolicy::connectionpolicy(std::string const&)'
proj.cpp:(.text._ZN4pqxx14connect_directC1ERKSs[_ZN4pqxx14connect_directC1ERKSs]+0x1e): undefined
 reference to `vtable for pqxx::connect_direct'
/var/tmp//ccNEqfUu.o: In function `pqxx::connect_direct::~connect_direct()':
proj.cpp:(.text._ZN4pqxx14connect_directD1Ev[_ZN4pqxx14connect_directD1Ev]+0xd): undefined reference to
 `vtable for pqxx::connect_direct'
proj.cpp:(.text._ZN4pqxx14connect_directD1Ev[_ZN4pqxx14connect_directD1Ev]+0x1d): undefined reference to
 `pqxx::connectionpolicy::~connectionpolicy()'
/var/tmp//ccNEqfUu.o: In function `pqxx::basic_connection<pqxx::connect_direct>::basic_connection()':
proj.cpp:(.text._ZN4pqxx16basic_connectionINS_14connect_directEEC1Ev[_ZN4pqxx16basic_connectionINS_14connect_direc
tEEC1Ev]+0x1d): undefined reference to `pqxx::connection_base::connection_base(pqxx::connectionpolicy&)'
proj.cpp:(.text._ZN4pqxx16basic_connectionINS_14connect_directEEC1Ev[_ZN4pqxx16basic_connectionINS_14connect_direc
tEEC1Ev]+0x51): undefined reference to `pqxx::connection_base::init()'
/var/tmp//ccNEqfUu.o: In function `pqxx::basic_connection<pqxx::connect_direct>::~basic_connection()':
proj.cpp:(.text._ZN4pqxx16basic_connectionINS_14connect_directEED1Ev[_ZN4pqxx16basic_connectionINS_14connect_direc
tEED1Ev]+0x14): undefined reference to `pqxx::connection_base::close()'

Any suggestions to a solution?

thank you
 
Thanks for the reply, solution found.

EDITED

Instead of this command, which generates an error:
[cmd=]g++ sqlTest.cpp -o sqlT -I /usr/local/include -L /usr/local/lib [/cmd]
I should have also included the suggestion by SirDice, along with the files
[cmd=]g++ sqlTest.cpp -o sqlT -I /usr/local/include -L /usr/local/lib -lpqxx -lpq[/cmd]

The compiler could not find those files because they were in another file, the lib folder. Thanks for the help.
 
Back
Top