Обсуждение: psql compiled with msys

Поиск
Список
Период
Сортировка

psql compiled with msys

От
"Merlin Moncure"
Дата:
Right now, psql does not allow copy & paste from the console window when
it is compiled under mingw.  However, the psql compiled with the
makefile for visual studio does.  Copy & Paste are enormously useful...
This may have to do with how the console window is constructed.

On another note, what is the future of the libpq makefile (win32.mak) in
src/interfaces?  if the wrong libpq.dll is resolved by psql, it will
crash psql...perhaps it should be removed or renamed msvc.mak (there is
a bcc32.mak for Borland also).

Merlin

Re: psql compiled with msys

От
"Magnus Hagander"
Дата:
> Right now, psql does not allow copy & paste from the console
> window when it is compiled under mingw.  However, the psql
> compiled with the makefile for visual studio does.  Copy &
> Paste are enormously useful... This may have to do with how
> the console window is constructed.

Probably. Definitly worth looking into :-)


> On another note, what is the future of the libpq makefile
> (win32.mak) in src/interfaces?  if the wrong libpq.dll is
> resolved by psql, it will crash psql...perhaps it should be
> removed or renamed msvc.mak (there is a bcc32.mak for Borland also).

Hmm. This sounds exactly like the problem Dann (IIRC) had a couple of
days back.

Since they are not compatible, we need to either find a way to make them
;-), or we should probably have two different libpq.dll:s - one for each
binary format. If they can't be made compatible, we *must* provide both
versions. If we can make them compatible, and everything is supported on
ming as is on msvc, we could just drop the msvc build stuff, IMHO.

Anybody know of a way to make mingw produce MS compatible DLLs?


//Magnus

Re: psql compiled with msys

От
"Merlin Moncure"
Дата:
Magnus Hagander wrote:
> Hmm. This sounds exactly like the problem Dann (IIRC) had a couple of
> days back.>
> Anybody know of a way to make mingw produce MS compatible DLLs?

Strictly speaking, all DLLs are MS compatible...barring the usual
annoying sundry issues like underscores, calling convention, etc.  I ran
the msys compiled DLL through Borland's impdef utility (generates an
export list) and got more or less the same results.

I then used implib to generate a library file for the dll for static
linking.  This also worked, but I got a warning (probably unrelated, but
still interesting):

C:\msys\1.0\local\pgsql\lib>"c:\Program
Files\Borland\CBuilder5\Bin\implib" libpq.lib libpq.dll

Borland Implib Version 3.0.22 Copyright (c) 1991, 2000 Inprise
Corporation
Warning duplicate symbol: pqFlush

So, I think Dann's problem more likely a versioning problem...i.e.
trying to use 7.4.1 libpq from 7.5b psql.  Of course, this is just
asking for a crash.  Unless the calling convention is different (and it
doesn't appear to be) I think the dlls are in fact compatible.  Worst
case scenario: the compiler flags on the msvc side have to be adjusted.
There might be more to it though.

Merlin

Re: psql compiled with msys

От
"Merlin Moncure"
Дата:
Magnus Hagander wrote:
> > Right now, psql does not allow copy & paste from the console
> > window when it is compiled under mingw.  However, the psql
> > compiled with the makefile for visual studio does.  Copy &
> > Paste are enormously useful... This may have to do with how
> > the console window is constructed.
>
> Probably. Definitly worth looking into :-)

Did a little checking and you can turn this on...  Right clicking on the
window title takes you to properties.  Unfortunately, the setting
doesn't 'stick'...every time you do anything after that, the setting
gets reset.  This might be a mingw problem.

Merlin

Re: psql compiled with msys

От
"Magnus Hagander"
Дата:
> > Hmm. This sounds exactly like the problem Dann (IIRC) had a
> couple of
> > days back.> Anybody know of a way to make mingw produce MS
> compatible
> > DLLs?
>
> Strictly speaking, all DLLs are MS compatible...barring the
> usual annoying sundry issues like underscores, calling
> convention, etc.  I ran the msys compiled DLL through
> Borland's impdef utility (generates an export list) and got
> more or less the same results.
>
> I then used implib to generate a library file for the dll for
> static linking.  This also worked, but I got a warning
> (probably unrelated, but still interesting):
>
> C:\msys\1.0\local\pgsql\lib>"c:\Program
> Files\Borland\CBuilder5\Bin\implib" libpq.lib libpq.dll
>
> Borland Implib Version 3.0.22 Copyright (c) 1991, 2000
> Inprise Corporation Warning duplicate symbol: pqFlush
>
> So, I think Dann's problem more likely a versioning
> problem...i.e. trying to use 7.4.1 libpq from 7.5b psql.  Of
> course, this is just asking for a crash.  Unless the calling
> convention is different (and it doesn't appear to be) I think
> the dlls are in fact compatible.  Worst case scenario: the
> compiler flags on the msvc side have to be adjusted. There
> might be more to it though.

Have there been any such incompatible interfaces changes in libpq?

If not, could it be a case of "matching import libraries"? E.g. if you
use the MS import library with the ming DLL, it won't work, and the
other way around. but if you use a ming library with a ming DLL, you can
use it with a MS app? (Ok, I have no idea if this applies, just throwing
out ideas)

//Magnus

Re: psql compiled with msys

От
weiping he
Дата:
Merlin Moncure 写道:

>Right now, psql does not allow copy & paste from the console window when
>it is compiled under mingw.
>
>

emm... work pretty good here, I'm using win2k, compiled with mings, and
when I need to copy something in psql envionment,
just left click you mouse, drag and draw a white box to select what you
need, and right click and copy
the selected to a buffer; and right again would paste those copyed into
your edit position in psql.exe.

to copy and paste from or to other editor, just use normal technical:
ctrl-c, ctr-v would be ok,
just remember: in psql.exe, right click the button is paste; but drag &
draw left button then click right button
is copy, that's it.


regards Laser

Re: psql compiled with msys

От
"Magnus Hagander"
Дата:
>> > Right now, psql does not allow copy & paste from the console
>> > window when it is compiled under mingw.  However, the psql
>> > compiled with the makefile for visual studio does.  Copy &
>> > Paste are enormously useful... This may have to do with how
>> > the console window is constructed.
>>
>> Probably. Definitly worth looking into :-)
>
>Did a little checking and you can turn this on...  Right
>clicking on the
>window title takes you to properties.  Unfortunately, the setting
>doesn't 'stick'...every time you do anything after that, the setting
>gets reset.  This might be a mingw problem.

Um, are you running these from the same console? I just tried it, and it
works just fine with both mingw and the msvc version, started from the
normal commandprompt.
Note that it is an option you can set on the shortcut used to start the
commandprompt (for example, both cygwin and visual studio turns it off
on their commandprompts, for some reason). I think this is where your
issue is, and not in psql.

//Magnus

Re: psql compiled with msys

От
"Merlin Moncure"
Дата:
> >
> >Did a little checking and you can turn this on...  Right
> >clicking on the
> >window title takes you to properties.  Unfortunately, the setting
> >doesn't 'stick'...every time you do anything after that, the setting
> >gets reset.  This might be a mingw problem.
>
> Um, are you running these from the same console? I just tried it, and
it
> works just fine with both mingw and the msvc version, started from the
> normal commandprompt.
> Note that it is an option you can set on the shortcut used to start
the
> commandprompt (for example, both cygwin and visual studio turns it off
> on their commandprompts, for some reason). I think this is where your
> issue is, and not in psql.

I was running msys 1.0.9...and 1 version back MinGW. I reinstalled &
recompile pg and it works ok now.

Merlin