Last step in getting perl drivers for Postgres
While trying to install new DBD::Pg drivers on mac os x Snow Leopard I got the error below, when running test code:
dyld: lazy symbol binding failed: Symbol not found: _PQconnectdb
Referenced from: /opt/local/lib/perl5/site_perl/5.10.1/darwin-2level/auto/DBD/Pg/Pg.bundle
Expected in: dynamic lookup
I found that the Makefile.PL that cpan made for DBD::Pg was pointed at the wrong directories for libraries. I made the changes below to Makefile.PL (located in ~/.cpan/build/XML-DOM-1.44-tM9lK0):
#$POSTGRES_INCLUDE = $ENV{POSTGRES_INCLUDE} || $pg->inc_dir || "$ENV{POSTGRES_HOME}/include";
$POSTGRES_INCLUDE = '/opt/local/include/postgresql83';
#$POSTGRES_LIB = $ENV{POSTGRES_LIB} || $pg->lib_dir || "$ENV{POSTGRES_HOME}/lib";
$POSTGRES_LIB = '/opt/local/lib/postgresql83';
Then
sudo perl Makefile.PL
sudo make test
sudo make install
And the error was gone.
Also I had to switch
#!/opt/local/bin/perl
# /usr/bin/perl
sudo perl Makefile.PL
sudo make test
sudo make install
And the error was gone.
Also I had to switch