Hi, Unfortunately the regular PostgreSQL distribution does not come with a debug version of the libPQ library, but libpqxx links to this version of the libPQ library for the debug build. The solution: download the PostgreSQL source, go to the same directory as in the normal distribution(src\interfaces\libpq, that should work AFAIK) and build the debug version of libpq. The precise way to do this should be in a README in there somewhere, I can't really elaborate right now because I'm in a shabby internet cafe in Kanchanaburi, Thailand, instead of at home. :-/ Anyway, after building the debug version (and the release version as well, while you're at it), you should then point the path in your COMMON file to your postgreSQL source directory. Then libpqxx should build just fine.
Side note to Jeroen: I'll update the README to cover this stuff when I get back. Apparently there is still some source for confusion! :-) Cheers, Bart On Tue, July 25, 2006 16:20, DEV wrote: > Okay. So I totally removed all copies of MSVC++ and reinstalled the > MSVC++.Net version 2003. I had to hunt down and add a dll file > (mspdb70.dll). Now this is what I am getting: > > C:\Dev\libpqxx-2.6.7\win32>nmake /f vc-libpqxx.mak STATIC > > Microsoft (R) Program Maintenance Utility Version 7.10.3077 > Copyright (C) Microsoft Corporation. All rights reserved. > > ------------------------------------------------------------- > Copying libpqD.dll to lib. > > IMPORTANT: you MUST copy this libpqd.dll into the directory > where your program's .EXE resides, or you must make sure that > it is in your system PATH. > ------------------------------------------------------------- > copy C:\Dev\postgresql-8.1.0\src\interfaces\libpq\debug\libpqd.dll > lib > The system cannot find the path specified. > NMAKE : fatal error U1077: 'copy' : return code '0x1' > Stop. > > I check my path C:\Dev\postgresql-8.1.0\src\interfaces\libpq\debug and it > is > not even there I do have C:\Dev\postgresql-8.1.0\src\interfaces\libpq I > have > the database engine running on the computer that I am trying to develop > on. > And can access it via pgadminIII, if that helps. > > I totally appreciate any and all help I have gotten thus far and may yet > get. > > Oh I have it working on linux just fine! I just need to develop some > windows apps now :-( > > > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Saturday, July 22, 2006 2:15 AM > To: Jeroen T. Vermeulen > Cc: DEV; [email protected] > Subject: Re: [libpqxx-general] Using lib files in MSVC++ > > 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 > _______________________________________________ Libpqxx-general mailing list [email protected] http://gborg.postgresql.org/mailman/listinfo/libpqxx-general
