Hi there,

I may add some extra help here.

>> When I build the app I get
>>
>> Linking...
>> psqltesting3.obj : error LNK2001: unresolved external symbol
>> _PQconnectdb
>> Debug/psqltesting3.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
>>
>> -----------------------------------------------------------------
>>
>> So I am using the wrong libpqxx lib file and need to rebuild using a newer
>> version but I am not sure what version I should be using or I don't
have the
>> lib file being called right when I build the app.

Two things:

1. Make sure that you are using the very latest version of libpqxx for
VC++, i.e., version 2.6.7.

2. Please link to the _static_ (i.e., non-DLL) version of libpqxx. I'm not
sure what it's called (and I can't look it up right now), but if you build
libpqxx using "nmake /f win32\vc-libpqxx.mak STATIC" then you only get
statically built libraries -- one .LIB file for debug mode (with a D at
the end) and one for release mode (without a D at the end). Building a
clean libpqxx 2.6.7 should therefore leave you with exactly the correct
libraries.

3. Note that libpqxx requires that you link to libpq.dll as well. When
vc-libpqxx.mak builds libpqxx, it copies the correct libpq.dll and its
import library into the library directory together with the libpqxx
library, so that there can be no confusion which files are to be used (it
can vary if you have multiple versions of PostgreSQL on your system). You
_must_ link to the provided import .LIB of the libpq DLL as well, AND you
must place the libpq.dll in the same directory as your .EXE! (This is
probably the cause of the problems.)

Hope this helps!

Cheers,
Bart




_______________________________________________
Libpqxx-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

Reply via email to