It looks like the linker is pulling in both libpqxx and libpqxx_staticD, 
which is unnecessary... but I don't see both of them on the linker 
command line. Did you statically link libpqxx_staticD into something 
which *is* included in your linker options (perhaps util.obj)?
You could confirm this by temporarily renaming your libpqxx_staticD 
files and/or moving them well out of the linker's search path, and 
seeing whether the error is the same.

If you want to be sure you didn't accidentally break your installation, 
you could untar a fresh download and diff the files.

depends.exe is a good tool for examining library dependencies: 
http://www.dependencywalker.com/

Hope that helps,
Curran

Gary Popov wrote:
> Hi guys, I recently compiled both libpq and libpqxx (as per 
> instructions) and it seems that everything was successful - I got a 
> folder full of .lib and .dlls files, all of the tests compiled okay and 
> then when I went to compile a really tiny test program, I got errors.
> 
> #include <pqxx/connection.hxx>
> #include <pqxx/transactor.hxx>
> 
> int main()
> {
>     pqxx::connection con("connection info was here");
>     pqxx::work test(con, "test");
>    
>     pqxx::result r =  test.exec("SELECT * FROM pg_user");
> }
> 
> Linker options (as seen from within MSVC8.0's linker tab..)
> 
> /OUT:"E:\test\Debug\test.exe" /INCREMENTAL /NOLOGO /MANIFEST 
> /MANIFESTFILE:"Debug\test.exe.intermediate.manifest" /DEBUG 
> /PDB:"e:\test\debug\test.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 
> /ERRORREPORT:PROMPT libpqxx.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
> 
> and the linker error is..
> 
> ------ Build started: Project: test, Configuration: Debug Win32 ------
> Linking...
> libpqxx_staticD.lib(util.obj) : error LNK2005: "public: __thiscall 
> pqxx::internal::refcount::~refcount(void)" 
> ([EMAIL PROTECTED]@pqxx@@[EMAIL PROTECTED]) already defined in 
> libpqxx.lib(libpqxx.dll)
> libpqxx_staticD.lib(util.obj) : error LNK2005: "public: bool __thiscall 
> pqxx::internal::refcount::loseref(void)" 
> ([EMAIL PROTECTED]@[EMAIL PROTECTED]@@QAE_NXZ) already defined in 
> libpqxx.lib(libpqxx.dll)
> E:\test\Debug\test.exe : fatal error LNK1169: one or more multiply 
> defined symbols found
> Build log was saved at "file://e:\test\test\Debug\BuildLog.htm"
> test - 3 error(s), 0 warning(s)
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
> 
> so... I'm wondering if I did something wrong? I recall fidling with the 
> header files a bit (uh-oh), but I don't remember 100% what I did. I 
> think I changed all of the instances of disable_noticer from 
> pqxx::internal::disable_noticer to just pqxx::disable_noticer, but I 
> don't see how this would have any impact... or would it?
> 
> Thanks for your help,
> Gary
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Libpqxx-general mailing list
> Libpqxx-general@gborg.postgresql.org
> http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

_______________________________________________
Libpqxx-general mailing list
Libpqxx-general@gborg.postgresql.org
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

Reply via email to