Re: Libpq.dll: File not recognized - Mailing list pgsql-bugs

From Dave Page
Subject Re: Libpq.dll: File not recognized
Date
Msg-id AANLkTimhF_eE6r1NfX_dSO3qE0eJKE06wwgiUR_8UwT7@mail.gmail.com
Whole thread Raw
In response to Re: Libpq.dll: File not recognized  ("Bidski" <bidski@bigpond.net.au>)
List pgsql-bugs
On Thu, Jul 1, 2010 at 9:00 AM, Bidski <bidski@bigpond.net.au> wrote:
> "Dave Page" <dpage@pgadmin.org> writes:
>>
>> Don't link against the DLL, link against the .lib.
>
> Isnt the .lib the static library and the dll the shared library?

No, it should be the import library for the DLL.

> And Im not
> linking against the dll specifically, that is the library that g++ is
> wanting to link to. My link command is
>
> =A0 g++ -Wl,--enable-auto-import -o"MRP.exe" =A0./src/DB.o ./src/catlist.o
> ./src/inventory.o ./src/mrp_app.o ./src/mrp_frame.o ./res/resources.rc.o
> -lpq -L"C:\MinGW\lib" -L"C:\Program Files\PostgreSQL\lib" -mwindows
> `wx-config --libs base,core,adv,xrc`

That looks right - and should be looking for the .lib (or a .a) as you
just have -lpq. Should there be a -m64 in there though? Try compiling
a test program and verify that you actually are getting 64 bit output.

>> The server is built with VC++ 2008 - I have no idea if Mingw can use
>> 64bit VC++ libraries.
>
> I also have no idea for certain, but I should think so. My understanding =
of
> the whole thing is that a DLL made for windows should be linkable to any
> windows application regardless of compiler/linker, if its not then what is
> the point?

The DLLs should be portable, but the import library might not be. I
vaguely recall that VC++ cannot use a Mingw import library - though
you can fairly easily create a compatible library from the
incompatible one. I don't recall the details though - Google is your
friend.


--=20
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company

pgsql-bugs by date:

Previous
From: "Bidski"
Date:
Subject: Re: Libpq.dll: File not recognized
Next
From: ""
Date:
Subject: BUG #5533: PQexecParams in Binary Mode returns incorrect value for float4