Обсуждение: compilig libpq with borland 5.5

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

compilig libpq with borland 5.5

От
"claudio lezcano"
Дата:
Hi everybody

Iam traying to build libpq.lib and libpq.dll library using Borland c++ 5.5 and i got these error:

"Error libpq.rc 1 11: Cannot open file: winver.h"

I opened the libpq.rc file and i saw the reference to that file "#include <winver.h>"

I cheched out the path and the existence of the file and everything is all right.

I actually find the file in the desired location.

I don't know what to do to carry on my work.

Can somebody help me out please?.

Thanks in advance.

Claudio Lezcano

Re: compilig libpq with borland 5.5

От
Bruce Momjian
Дата:
Uh, what version of Postgres are you testing?  Would you email the
output of the compile so we can see why it isn't find it?  My guess is
that borland CC isn't configured to find the Windows include directory.

---------------------------------------------------------------------------

claudio lezcano wrote:
> Hi everybody
> 
> Iam traying to build libpq.lib and libpq.dll library using Borland c++ 5.5
> and i got these error:
> 
> "Error libpq.rc 1 11: Cannot open file: winver.h"
> 
> I opened the libpq.rc file and i saw the reference to that file "#include
> <winver.h>"
> 
> I cheched out the path and the existence of the file and everything is all
> right.
> 
> I actually find the file in the desired location.
> 
> I don't know what to do to carry on my work.
> 
> Can somebody help me out please?.
> 
> Thanks in advance.
> 
> Claudio Lezcano

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


Re: compilig libpq with borland 5.5

От
"Merlin Moncure"
Дата:
On Thu, Jul 31, 2008 at 1:52 PM, claudio lezcano <claudiogmi@gmail.com> wrote:
> Hi everybody
>
> Iam traying to build libpq.lib and libpq.dll library using Borland c++ 5.5
> and i got these error:
>
> "Error libpq.rc 1 11: Cannot open file: winver.h"
>
> I opened the libpq.rc file and i saw the reference to that file "#include
> <winver.h>"
>
> I cheched out the path and the existence of the file and everything is all
> right.
>
> I actually find the file in the desired location.
>
> I don't know what to do to carry on my work.
>
> Can somebody help me out please?.

Just in case you can't get it working, you can always take a msvc
compiled libpq.dll and create a static library out of it with the
'implib' utility using the underscore option.

merlin


Re: compilig libpq with borland 5.5

От
"claudio lezcano"
Дата:
Thank you so much for the comments, he managed to advance the process of reconfiguring the directory compilation include Borland, however, has emerged another drawback, the problem has drawn up the following message:

Error: Unresolved external '_pgwin32_safestat' referenced from C:\SOURCE POSTGRES 8.3\SRC\INTERFACES\LIBPQ\RELEASE\BLIBPQ.LIB|fe-connect

Obs.: Static or dynamic libraries generated by the mvs can not be used to compile sources with bcc32, but works for MinGW and others, while trying to compile the following problem arises with bcc32:

Error: 'C: \ examples \ LIBPQ.LIB' contains invalid FMO record, type 0x21 (possibly COFF)
** error 2 ** deleting ".\Release\blibpq.dll"

Thanks in advance
Claudio Lezcano

Re: compilig libpq with borland 5.5

От
"Merlin Moncure"
Дата:
On Thu, Aug 14, 2008 at 9:02 AM, claudio lezcano <claudiogmi@gmail.com> wrote:
> Thank you so much for the comments, he managed to advance the process of
> reconfiguring the directory compilation include Borland, however, has
> emerged another drawback, the problem has drawn up the following message:
>
> Error: Unresolved external '_pgwin32_safestat' referenced from C:\SOURCE
> POSTGRES 8.3\SRC\INTERFACES\LIBPQ\RELEASE\BLIBPQ.LIB|fe-connect
>
> Obs.: Static or dynamic libraries generated by the mvs can not be used to
> compile sources with bcc32, but works for MinGW and others, while trying to
> compile the following problem arises with bcc32:

You are correct about static libraries.  If you have a 'COFF' (usually
microsoft in this context) static library, the only tool I know of to
get it working with the Borland stack is the Digital Mars COFF->OMF
converter, which works, and is the only way to go if you have a static
library which is not a stub for a dll (fully static) and don't
have/can't compile the source.

Dynamic libraries, however, can be shared between the compilers.  You
can either load all the symbols with LoadLibrary, etc, or generate a
static library.   Borland's implib.exe utility generates a static
library from any dll so you don't have to use LoadLibary, .etc, just
the header for the symbols from the library which you want to use.

Format problems between the compilers are one of the many reasons why
static libraries (except for statically loaded .dll) have fallen out
of favor...you hardly ever see them anymore.

merlin


Re: compilig libpq with borland 5.5

От
Bruce Momjian
Дата:
Merlin Moncure wrote:
> On Thu, Jul 31, 2008 at 1:52 PM, claudio lezcano <claudiogmi@gmail.com> wrote:
> > Hi everybody
> >
> > Iam traying to build libpq.lib and libpq.dll library using Borland c++ 5.5
> > and i got these error:
> >
> > "Error libpq.rc 1 11: Cannot open file: winver.h"
> >
> > I opened the libpq.rc file and i saw the reference to that file "#include
> > <winver.h>"
> >
> > I cheched out the path and the existence of the file and everything is all
> > right.
> >
> > I actually find the file in the desired location.
> >
> > I don't know what to do to carry on my work.
> >
> > Can somebody help me out please?.
>
> Just in case you can't get it working, you can always take a msvc
> compiled libpq.dll and create a static library out of it with the
> 'implib' utility using the underscore option.

I have applied the attached patch to CVS HEAD and 8.3.X to sychronize
bcc with msvc makefiles.  Please let me know if you have further
problems.  Thanks for the report.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: src/interfaces/libpq/bcc32.mak
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/libpq/bcc32.mak,v
retrieving revision 1.29
diff -c -c -r1.29 bcc32.mak
*** src/interfaces/libpq/bcc32.mak    26 Feb 2008 13:31:40 -0000    1.29
--- src/interfaces/libpq/bcc32.mak    16 Aug 2008 01:53:58 -0000
***************
*** 93,104 ****
      -@erase "$(INTDIR)\fe-secure.obj"
      -@erase "$(INTDIR)\pqexpbuffer.obj"
      -@erase "$(INTDIR)\pqsignal.obj"
!     -@erase "$(OUTDIR)\win32.obj"
      -@erase "$(INTDIR)\wchar.obj"
      -@erase "$(INTDIR)\encnames.obj"
      -@erase "$(INTDIR)\pthread-win32.obj"
      -@erase "$(INTDIR)\snprintf.obj"
      -@erase "$(INTDIR)\strlcpy.obj"
      -@erase "$(OUTDIR)\$(OUTFILENAME).lib"
      -@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib"
      -@erase "$(OUTDIR)\libpq.res"
--- 93,109 ----
      -@erase "$(INTDIR)\fe-secure.obj"
      -@erase "$(INTDIR)\pqexpbuffer.obj"
      -@erase "$(INTDIR)\pqsignal.obj"
!     -@erase "$(INTDIR)\win32.obj"
      -@erase "$(INTDIR)\wchar.obj"
      -@erase "$(INTDIR)\encnames.obj"
      -@erase "$(INTDIR)\pthread-win32.obj"
      -@erase "$(INTDIR)\snprintf.obj"
      -@erase "$(INTDIR)\strlcpy.obj"
+     -@erase "$(INTDIR)\dirent.obj"
+     -@erase "$(INTDIR)\dirmod.obj"
+     -@erase "$(INTDIR)\pgsleep.obj"
+     -@erase "$(INTDIR)\open.obj"
+     -@erase "$(INTDIR)\win32error.obj"
      -@erase "$(OUTDIR)\$(OUTFILENAME).lib"
      -@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib"
      -@erase "$(OUTDIR)\libpq.res"
***************
*** 134,139 ****
--- 139,149 ----
      "$(INTDIR)\encnames.obj" \
      "$(INTDIR)\snprintf.obj" \
      "$(INTDIR)\strlcpy.obj" \
+     "$(INTDIR)\dirent.obj" \
+     "$(INTDIR)\dirmod.obj" \
+     "$(INTDIR)\pgsleep.obj" \
+     "$(INTDIR)\open.obj" \
+     "$(INTDIR)\win32error.obj" \
      "$(INTDIR)\pthread-win32.obj"


***************
*** 238,244 ****

  "$(INTDIR)\strlcpy.obj" : ..\..\port\strlcpy.c
      $(CPP) @<<
!     $(CPP_PROJ) ..\..\port\strlcpy.c
  <<


--- 248,279 ----

  "$(INTDIR)\strlcpy.obj" : ..\..\port\strlcpy.c
      $(CPP) @<<
!     $(CPP_PROJ) /I"." ..\..\port\strlcpy.c
! <<
!
! "$(INTDIR)\dirent.obj" : ..\..\port\dirent.c
!     $(CPP) @<<
!     $(CPP_PROJ) /I"." ..\..\port\dirent.c
! <<
!
! "$(INTDIR)\dirmod.obj" : ..\..\port\dirmod.c
!     $(CPP) @<<
!     $(CPP_PROJ) /I"." ..\..\port\dirmod.c
! <<
!
! "$(INTDIR)\pgsleep.obj" : ..\..\port\pgsleep.c
!     $(CPP) @<<
!     $(CPP_PROJ) /I"." ..\..\port\pgsleep.c
! <<
!
! "$(INTDIR)\open.obj" : ..\..\port\open.c
!     $(CPP) @<<
!     $(CPP_PROJ) /I"." ..\..\port\open.c
! <<
!
! "$(INTDIR)\win32error.obj" : ..\..\port\win32error.c
!     $(CPP) @<<
!     $(CPP_PROJ) /I"." ..\..\port\win32error.c
  <<



Re: compilig libpq with borland 5.5

От
"claudio lezcano"
Дата:
I made tests compiling both sources (from CVS repository and from HTTP), and i got the next results:

1-) MSVS 2005
    Source from CVS repository: fatal error U1073: "Don't know how to make 'libpq-dist.rc'"
    Source from http (ver. 8.3.3): Successfully generated

2.) Borland 5.5.1
    Source from CVS repository:
Error E2451 ..\..\port\dirent.c 35: Undefined symbol 'INVALID_FILE_ATTRIBUTES' in function opendir
Error E2451 ..\..\port\dirent.c 52: Undefined symbol 'dirname' in function opendir
Error E2451 ..\..\port\dirent.c 53: Undefined symbol 'dirname' in function opendir
Error E2451 ..\..\port\dirent.c 59: Undefined symbol 'dirname' in function opendir
Error E2451 ..\..\port\dirent.c 60: Undefined symbol 'dirname' in function opendir
Error E2451 ..\..\port\dirent.c 60: Undefined symbol 'dirname' in function opendir
Error E2451 ..\..\port\dirent.c 61: Undefined symbol 'dirname' in function opendir
Error E2451 ..\..\port\dirent.c 61: Undefined symbol 'dirname' in function opendir
Error E2451 ..\..\port\dirent.c 62: Undefined symbol 'dirname' in function opendir
Error E2451 ..\..\port\dirent.c 64: Undefined symbol 'dirname' in function opendir
Error E2451 ..\..\port\dirent.c 65: Undefined symbol 'handle' in function opendir
Error E2451 ..\..\port\dirent.c 66: Undefined symbol 'ret' in function opendir
Error E2451 ..\..\port\dirent.c 67: Undefined symbol 'ret' in function opendir
Error E2451 ..\..\port\dirent.c 77: Undefined symbol 'handle' in function readdir
Error E2451 ..\..\port\dirent.c 79: Undefined symbol 'handle' in function readdir
Error E2451 ..\..\port\dirent.c 79: Undefined symbol 'dirname' in function readdir
Error E2451 ..\..\port\dirent.c 80: Undefined symbol 'handle' in function readdir
Error E2451 ..\..\port\dirent.c 88: Undefined symbol 'handle' in function readdir
Error E2451 ..\..\port\dirent.c 100: Undefined symbol 'ret' in function readdir
Error E2451 ..\..\port\dirent.c 102: Undefined symbol 'ret' in function readdir
Error E2451 ..\..\port\dirent.c 102: Undefined symbol 'ret' in function readdir
Error E2451 ..\..\port\dirent.c 103: Undefined symbol 'ret' in function readdir
Error E2451 ..\..\port\dirent.c 109: Undefined symbol 'handle' in function closedir
Error E2451 ..\..\port\dirent.c 110: Undefined symbol 'handle' in function closedir
Error E2451 ..\..\port\dirent.c 111: Undefined symbol 'dirname' in function closedir
Error E2228 ..\..\port\dirent.c 111: Too many error or warning messages in function closedir
*** 26 errors in Compile ***
** error 1 ** deleting ".\Release\dirent.obj"

Source from http (ver. 8.3.3):
Warning: 'win32' not found in library
Warning: 'getaddrinfo' not found in library
Warning: 'pgstrcasecmp' not found in library
Warning: 'thread' not found in library
Warning: 'inet_aton' not found in library
Warning: 'crypt' not found in library
Warning: 'noblock' not found in library
Warning: 'md5' not found in library
Warning: 'ip' not found in library
Warning: 'fe-auth' not found in library
Warning: 'fe-protocol2' not found in library
Warning: 'fe-protocol3' not found in library
Warning: 'fe-connect' not found in library
Warning: 'fe-exec' not found in library
Warning: 'fe-lobj' not found in library
Warning: 'fe-misc' not found in library
Warning: public '_pqFlush' in module 'fe-misc' clashes with prior module 'fe-exec'
Warning: 'fe-print' not found in library
Warning: 'fe-secure' not found in library
Warning: 'pqexpbuffer' not found in library
Warning: 'pqsignal' not found in library
Warning: 'wchar' not found in library
Warning: 'encnames' not found in library
Warning: 'snprintf' not found in library
Warning: 'strlcpy' not found in library
Warning: 'pthread-win32' not found in library
Warning: '' not found in library
Warning: '.OBJ' file not found
        brcc32.exe -l 0x409 -iC:\Borland\BCC55\include -fo".\Release\libpq.res"
libpq.rc
Borland Resource Compiler  Version 5.40
Copyright (c) 1990, 1999 Inprise Corporation.  All rights reserved.
        ilink32.exe @MAKE0000.@@@
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_pgwin32_safestat' referenced from C:\SOURCE POSTGRES 8.3\SRC\INTERFACES\LIBPQ\REL
EASE\BLIBPQ.LIB|fe-connect

** error 2 ** deleting ".\Release\blibpq.dll"

He would welcome any suggestions or help

Claudio Lezcano

Re: compilig libpq with borland 5.5

От
"Hiroshi Saito"
Дата:
Hi.

>I made tests compiling both sources (from CVS repository and from HTTP), and
>i got the next results:
>
>1-) MSVS 2005
>    *Source from CVS repository: *fatal error U1073: "Don't know how to make
>'libpq-dist.rc'"
>    *Source from http (ver. 8.3.3): **Successfully generated*

It can be made from 'make distprep'. and def file is also made.
However, I make it except windows environment.

Regards,
Hiroshi Saito