Thread: Trying Compile libpq.dll with VC++ 9.0, but need help

Trying Compile libpq.dll with VC++ 9.0, but need help

From
Tony Caduto
Date:
Hi,
Trying to get a libpq.dll that only has SSL deps using these instructions:

http://www.postgresql.org/docs/8.3/interactive/install-win32-libpq.html

It compiles a bit then dies at:

C:\postgresql-8.3.5\src\interfaces\libpq>nmake /f win32.mak

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

Building the Win32 static library...

Using default OpenSSL Include directory: C:\OpenSSL\include
Using default OpenSSL Library directory: C:\OpenSSL\lib\VC
Using default Kerberos Include directory: C:\kfw-2.6.5\inc
Using default Kerberos Library directory: C:\kfw-2.6.5\lib\i386
        link.exe -lib @C:\DOCUME~1\20659\LOCALS~1\Temp\nm1B.tmp
.\Release\win32.obj : fatal error LNK1107: invalid or corrupt file:
cannot read at 0xB39
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
Studio 9.0\VC\BIN\link.exe"' : return code '0x453'
Stop.



Re: Trying Compile libpq.dll with VC++ 9.0, but need help

From
"Dann Corbit"
Date:
> -----Original Message-----
> From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-
> owner@postgresql.org] On Behalf Of Tony Caduto
> Sent: Monday, November 17, 2008 12:06 PM
> To: pgsql-general@postgresql.org
> Subject: [GENERAL] Trying Compile libpq.dll with VC++ 9.0, but need
> help
>
> Hi,
> Trying to get a libpq.dll that only has SSL deps using these
> instructions:
>
>
http://www.postgresql.org/docs/8.3/interactive/install-win32-libpq.html
>
> It compiles a bit then dies at:
>
> C:\postgresql-8.3.5\src\interfaces\libpq>nmake /f win32.mak
>
> Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
> Copyright (C) Microsoft Corporation.  All rights reserved.
>
> Building the Win32 static library...
>
> Using default OpenSSL Include directory: C:\OpenSSL\include
> Using default OpenSSL Library directory: C:\OpenSSL\lib\VC
> Using default Kerberos Include directory: C:\kfw-2.6.5\inc
> Using default Kerberos Library directory: C:\kfw-2.6.5\lib\i386
>         link.exe -lib @C:\DOCUME~1\20659\LOCALS~1\Temp\nm1B.tmp
> .\Release\win32.obj : fatal error LNK1107: invalid or corrupt file:
> cannot read at 0xB39
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
> Studio 9.0\VC\BIN\link.exe"' : return code '0x453'
> Stop.

How much disk space do you have?

I guess that you are running out of space.

During the link, watch the available disk space.

Re: Trying Compile libpq.dll with VC++ 9.0, but need help

From
Tony Caduto
Date:
Dann Corbit wrote:
>
>
> How much disk space do you have?
>
> I guess that you are running out of space.
>
> During the link, watch the available disk space.
>
>

Hi Dan,
Thanks for the reply :-)

I actually got it working.    Now the only problem is it still has a
dependency for
MSVCR90.DLL

Does anyone know if this can be done with mingw so I can eliminate the
MSVCR90.DLL dependency?
I have it installed but that is even more foreign to me than VS :-)
(mostly use borland CodeGear tools)

Thanks,

Tony

Re: Trying Compile libpq.dll with VC++ 9.0, but need help

From
"Dave Page"
Date:
On Mon, Nov 17, 2008 at 8:43 PM, Tony Caduto
<tony_caduto@amsoftwaredesign.com> wrote:

> Does anyone know if this can be done with mingw so I can eliminate the
> MSVCR90.DLL dependency?
> I have it installed but that is even more foreign to me than VS :-)  (mostly
> use borland CodeGear tools)

That's the easiest way of all:

./configure --with-openssl
cd src/interfaces/libpq
make all

should do the trick.

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: Trying Compile libpq.dll with VC++ 9.0, but need help

From
"Dann Corbit"
Date:
> -----Original Message-----
> From: Tony Caduto [mailto:tony_caduto@amsoftwaredesign.com]
> Sent: Monday, November 17, 2008 12:44 PM
> To: Dann Corbit
> Cc: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Trying Compile libpq.dll with VC++ 9.0, but
need
> help
>
> Dann Corbit wrote:
> >
> >
> > How much disk space do you have?
> >
> > I guess that you are running out of space.
> >
> > During the link, watch the available disk space.
> >
> >
>
> Hi Dan,
> Thanks for the reply :-)
>
> I actually got it working.    Now the only problem is it still has a
> dependency for
> MSVCR90.DLL
>
> Does anyone know if this can be done with mingw so I can eliminate the
> MSVCR90.DLL dependency?
> I have it installed but that is even more foreign to me than VS :-)
> (mostly use borland CodeGear tools)

Change from /MD to /MT and it will not use the runtime DLL.
Look under: Properties -> Configuration Properties -> C/C++ -> Code
Generation -> Runtime Library


Re: Trying Compile libpq.dll with VC++ 9.0, but need help

From
Tony Caduto
Date:
Dann Corbit wrote:
> Change from /MD to /MT and it will not use the runtime DLL.
> Look under: Properties -> Configuration Properties -> C/C++ -> Code
> Generation -> Runtime Library
>
>
>

Hi Dann,

I changed that in the win32.mak file and now it gives this error:

        link.exe @C:\DOCUME~1\20659\LOCALS~1\Temp\nmA6.tmp
   Creating library .\Release\libpqdll.lib and object .\Release\libpqdll.exp
LIBCMT.lib(dosmap.obj) : error LNK2005: __dosmaperr already defined in
libpq.lib(win32error.obj)
.\Release\libpq.dll : fatal error LNK1169: one or more multiply defined
symbols found
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
Studio 9.0\VC\BIN\link.exe"' : return code '0x491'
Stop.





Re: Trying Compile libpq.dll with VC++ 9.0, but need help

From
"Hiroshi Saito"
Date:
Hi.

It is very strange....

I checked that it was ready in VC9 again.
http://winpg.jp/~saito/pg_work/WIN32_BUILD_INF/LOG_LIBPQ_WIN32MAK.txt
Furthermore, even psql was checked.
http://winpg.jp/~saito/pg_work/WIN32_BUILD_INF/psql_win32_pg83.mak
Please move psql_win32_pg83 win32.mak on src\bin\psql.
http://winpg.jp/~saito/pg_work/WIN32_BUILD_INF/LOG_PSQL_WIN32MAK.txt

However, It will be necessary what is bad and to investigate in your environment.

I think....

1. One proposal
nmake -f win32.mak clean

Regards,
Hiroshi Saito

----- Original Message -----
From: "Tony Caduto" <tony_caduto@amsoftwaredesign.com>


> Dann Corbit wrote:
>> Change from /MD to /MT and it will not use the runtime DLL.
>> Look under: Properties -> Configuration Properties -> C/C++ -> Code
>> Generation -> Runtime Library
>>
>>
>>
>
> Hi Dann,
>
> I changed that in the win32.mak file and now it gives this error:
>
>        link.exe @C:\DOCUME~1\20659\LOCALS~1\Temp\nmA6.tmp
>   Creating library .\Release\libpqdll.lib and object .\Release\libpqdll.exp
> LIBCMT.lib(dosmap.obj) : error LNK2005: __dosmaperr already defined in
> libpq.lib(win32error.obj)
> .\Release\libpq.dll : fatal error LNK1169: one or more multiply defined
> symbols found
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
> Studio 9.0\VC\BIN\link.exe"' : return code '0x491'
> Stop.
>
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

Re: Trying Compile libpq.dll with VC++ 9.0, but need help

From
Tony Caduto
Date:
Hiroshi Saito wrote:
> Hi.
>
> It is very strange....
>
> I checked that it was ready in VC9 again.
> http://winpg.jp/~saito/pg_work/WIN32_BUILD_INF/LOG_LIBPQ_WIN32MAK.txt
> Furthermore, even psql was checked.
> http://winpg.jp/~saito/pg_work/WIN32_BUILD_INF/psql_win32_pg83.mak
> Please move psql_win32_pg83 win32.mak on src\bin\psql.
> http://winpg.jp/~saito/pg_work/WIN32_BUILD_INF/LOG_PSQL_WIN32MAK.txt
>
> However, It will be necessary what is bad and to investigate in your
> environment.
>
> I think....
>
> 1. One proposal nmake -f win32.mak clean
>
> Regards,
> Hiroshi Saito
>
> -


Hi,

I will give it another try tomorrow.  It could be something related to
the fact that I am running on XP 64bit.  I will try and compile it on a
VM with 32bit XP, and also try to build it with MinGW.  I did try the
clean and it didn't make any difference.  It compiles fine with the
/MD option, I even got it to compile against the lastest openSSL, though
I did have to comment out one little line.

Thanks,

Tony