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

Reply via email to