[Repost but now it goes to the list!]

Curran Schiefelbein wrote:
> Hi,
> 
> I went to build a new app (uses standard windows libs, not MFC) on a 
> different Windows box, downloaded postgresql-base-8.2.3 (built from 
> source with win32.mak, no problem) and libpqxx-2.6.9 (built from source 
> with vc-libpqxx.mak, target STATICRELEASE, no apparent problems that 
> haven't already been solved).
> 
> My app's linker options:
> /OUT:"Debug\myapp.exe" /INCREMENTAL /NOLOGO 
> /LIBPATH:"..\vendor\libpqxx-2.6.9\lib" 
> /LIBPATH:"..\vendor\postgresql-8.2.3\src\interfaces\libpq\Release" 
> /MANIFEST /MANIFESTFILE:"Debug\myapp.exe.intermediate.manifest" /DEBUG 
> /PDB:"c:\Documents and Settings\nachbar\My Documents\path\to\myapp.pdb" 
> /SUBSYSTEM:CONSOLE /MACHINE:X86 /ERRORREPORT:PROMPT libpq.lib 
> libpqxx_static.lib ws2_32.lib  kernel32.lib user32.lib gdi32.lib 
> winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib 
> oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
> 
> My linker error:
> LINK : fatal error LNK1104: cannot open file 'libpqddll.lib'
> 
> Since I built postgresql and libpqxx release-only, where's the 
> libpq*D*dll.lib dependency coming from?
> 
> Are there any tools I can use to examine the .o files or the 
> libpqxx_static.lib to get a better clue?
> 
> Is the /DEBUG linker option triggering something in the .lib file that 
> it shouldn't be?
> 
> Help please :) I'm stumped.

Hi Curran,

The dependencies are produced by the libpqxx header files that you
include in your app. include/pqxx/compiler-public.hxx has:

[snip]
// Automatically link with the appropriate libpq DLL (debug or release).
#ifdef _DEBUG
#pragma comment(lib, "libpqddll")
#else
#pragma comment(lib, "libpqdll")
#endif
[/snip]

This means that if your C++ compiler settings contains the _DEBUG
preporcessor define, libpqxx will assume that you want to link to the
debug libraries of libpqxx and libpq. And this really is how it should
be -- you share the MSVC runtime library with libpqxx, so you can only
link a debug app with a library that also uses the debug runtime
library. (That debug-libpqxx depends on debug-libpq is less obvious, but
we had to pick either one, and the release-libpq is not debuggable.)

Cheers,
Bart




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

Reply via email to