I'm writing an application that links all 3rd party code via static libraries (including tinyxml2, sqlite3, openssl and libpq); everything is working fine beyond whenever I try to link to libpqd.lib - having used the 9.1.9 and 9.2.4 sources - I'm getting:
1>LIBCMTD.lib(dosmap.obj) : error LNK2005: __dosmaperr already defined in libpqd.lib(win32error.obj)
This is the only error, and my searching so far has been fruitless. Note that I'm using the Multi-threaded Debug runtime library /MTd
in all the libraries, which postgresql doesn't have by default; I've manually patched the win32.mak to use /MTd
and /MT
in place of the previously unconfigurable /MDd
and /MD
. This resolved some previous linker errors, but don't think it's related to this final one, as it was present prior.
I compile libpq via:
nmake /f win32.mak DEBUG=1
and link to it by:
#pragma comment ( lib, "libpqd.lib" )
The library directory is configured within the project, and the library is copied into this folder, so I know it's the correct one being used.
This is usually an error easily resolved, but I'm not sure where to look anymore!
A thread does exist about this on the postgresql site, but doesn't appear to have been resolved: http://www.postgresql.org/message-id/39E6FC4547C24F9884435E23698B11DC@HIRO57887DE653