Thread: compilig libpq with borland 5.5

compilig libpq with borland 5.5

From
"claudio lezcano"
Date:
<div dir="ltr">Hi everybody<br /><br />Iam traying to build libpq.lib and libpq.dll library using Borland c++ 5.5 and i
gotthese error:<br /><br />"Error libpq.rc 1 11: Cannot open file: winver.h"<br /><br />I opened the libpq.rc file and
isaw the reference to that file "#include <winver.h>" <br /><br />I cheched out the path and the existence of the
fileand everything is all right.<br /><br />I actually find the file in the desired location.<br /><br />I don't know
whatto do to carry on my work.<br /><br />Can somebody help me out please?.<br /><br />Thanks in advance.<br /><br
/>ClaudioLezcano</div> 

Re: compilig libpq with borland 5.5

From
Bruce Momjian
Date:
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

From
"Merlin Moncure"
Date:
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

From
"claudio lezcano"
Date:
<div dir="ltr">Thank you so much for the comments, he managed to advance the process of reconfiguring the directory
compilationinclude Borland, however, has emerged another drawback, the problem has drawn up the following message: <br
/><divdir="ltr" id="result_box"><br /><span style="font-family: courier new,monospace;"> Error: Unresolved external
'_pgwin32_safestat'referenced from C:\</span><span style="font-family: courier new,monospace;">SOURCE POSTGRES
8.3\SRC\INTERFACES\LIBPQ\REL</span><spanstyle="font-family: courier
new,monospace;">EASE\BLIBPQ.LIB|fe-connect</span><brstyle="font-family: courier new,monospace;" /><br /> Obs.: Static
ordynamic libraries generated by the mvs can not be used to compile sources with bcc32, but works for MinGW and others,
whiletrying to compile the following problem arises with bcc32: <br /><br /><span style="font-family: courier
new,monospace;">Error: 'C: \ examples \ LIBPQ.LIB' contains invalid FMO record, type 0x21 (possibly
COFF)</span></div><spanstyle="font-family: courier new,monospace;">** error 2 ** deleting ".\Release\blibpq.dll"<br
/><br/>Thanks in advance<br />Claudio Lezcano<br /></span></div> 

Re: compilig libpq with borland 5.5

From
"Merlin Moncure"
Date:
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

From
Bruce Momjian
Date:
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

From
"claudio lezcano"
Date:
<div dir="ltr">I made tests compiling both sources (from CVS repository and from HTTP), and i got the next results:<br
/><br/>1-) MSVS 2005<br />    <b>Source from CVS repository: </b><span style="font-family: courier
new,monospace;">fatalerror U1073: "Don't know how to make 'libpq-dist.rc'"</span><br />     <b>Source from http (ver.
8.3.3):</b><i>Successfully generated</i><br /><br />2.) Borland 5.5.1<br />   <b> Source from CVS repository:</b><span
style="font-family:courier new,monospace;"><br /></span><div style="margin-left: 80px;"><span style="font-family:
couriernew,monospace;">Error E2451 ..\..\port\dirent.c 35: Undefined symbol 'INVALID_FILE_ATTRIBUTES' in function
opendir</span><brstyle="font-family: courier new,monospace;" /></div><div style="margin-left: 80px;"><span
style="font-family:courier new,monospace;">Error E2451 ..\..\port\dirent.c 52: Undefined symbol 'dirname' in function
opendir</span><brstyle="font-family: courier new,monospace;" /><span style="font-family: courier new,monospace;"> Error
E2451..\..\port\dirent.c 53: Undefined symbol 'dirname' in function opendir</span><br style="font-family: courier
new,monospace;"/><span style="font-family: courier new,monospace;">Error E2451 ..\..\port\dirent.c 59: Undefined symbol
'dirname'in function opendir</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier
new,monospace;">ErrorE2451 ..\..\port\dirent.c 60: Undefined symbol 'dirname' in function opendir</span><br
style="font-family:courier new,monospace;" /><span style="font-family: courier new,monospace;"> Error E2451
..\..\port\dirent.c60: Undefined symbol 'dirname' in function opendir</span><br style="font-family: courier
new,monospace;"/><span style="font-family: courier new,monospace;">Error E2451 ..\..\port\dirent.c 61: Undefined symbol
'dirname'in function opendir</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier
new,monospace;">ErrorE2451 ..\..\port\dirent.c 61: Undefined symbol 'dirname' in function opendir</span><br
style="font-family:courier new,monospace;" /><span style="font-family: courier new,monospace;"> Error E2451
..\..\port\dirent.c62: Undefined symbol 'dirname' in function opendir</span><br style="font-family: courier
new,monospace;"/><span style="font-family: courier new,monospace;">Error E2451 ..\..\port\dirent.c 64: Undefined symbol
'dirname'in function opendir</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier
new,monospace;">ErrorE2451 ..\..\port\dirent.c 65: Undefined symbol 'handle' in function opendir</span><br
style="font-family:courier new,monospace;" /><span style="font-family: courier new,monospace;"> Error E2451
..\..\port\dirent.c66: Undefined symbol 'ret' in function opendir</span><br style="font-family: courier new,monospace;"
/><spanstyle="font-family: courier new,monospace;">Error E2451 ..\..\port\dirent.c 67: Undefined symbol 'ret' in
functionopendir</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier
new,monospace;">ErrorE2451 ..\..\port\dirent.c 77: Undefined symbol 'handle' in function readdir</span><br
style="font-family:courier new,monospace;" /><span style="font-family: courier new,monospace;">Error E2451
..\..\port\dirent.c79: Undefined symbol 'handle' in function readdir</span><br style="font-family: courier
new,monospace;"/><span style="font-family: courier new,monospace;">Error E2451 ..\..\port\dirent.c 79: Undefined symbol
'dirname'in function readdir</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier
new,monospace;">ErrorE2451 ..\..\port\dirent.c 80: Undefined symbol 'handle' in function readdir</span><br
style="font-family:courier new,monospace;" /><span style="font-family: courier new,monospace;">Error E2451
..\..\port\dirent.c88: Undefined symbol 'handle' in function readdir</span><br style="font-family: courier
new,monospace;"/><span style="font-family: courier new,monospace;">Error E2451 ..\..\port\dirent.c 100: Undefined
symbol'ret' in function readdir</span><br style="font-family: courier new,monospace;" /><span style="font-family:
couriernew,monospace;">Error E2451 ..\..\port\dirent.c 102: Undefined symbol 'ret' in function readdir</span><br
style="font-family:courier new,monospace;" /><span style="font-family: courier new,monospace;"> Error E2451
..\..\port\dirent.c102: Undefined symbol 'ret' in function readdir</span><br style="font-family: courier
new,monospace;"/><span style="font-family: courier new,monospace;">Error E2451 ..\..\port\dirent.c 103: Undefined
symbol'ret' in function readdir</span><br style="font-family: courier new,monospace;" /><span style="font-family:
couriernew,monospace;">Error E2451 ..\..\port\dirent.c 109: Undefined symbol 'handle' in function closedir</span><br
style="font-family:courier new,monospace;" /><span style="font-family: courier new,monospace;">Error E2451
..\..\port\dirent.c110: Undefined symbol 'handle' in function closedir</span><br style="font-family: courier
new,monospace;"/><span style="font-family: courier new,monospace;">Error E2451 ..\..\port\dirent.c 111: Undefined
symbol'dirname' in function closedir</span><br style="font-family: courier new,monospace;" /><span style="font-family:
couriernew,monospace;">Error E2228 ..\..\port\dirent.c 111: Too many error or warning messages in function
closedir</span><brstyle="font-family: courier new,monospace;" /><span style="font-family: courier new,monospace;">***
26errors in Compile ***</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier
new,monospace;">**error 1 ** deleting ".\Release\dirent.obj"</span><br /><br /></div><div style="margin-left:
40px;"><b>Sourcefrom http (ver. 8.3.3):</b><br /></div><div style="margin-left: 40px;"><div style="margin-left:
40px;"><spanstyle="font-family: courier new,monospace;">Warning: 'win32' not found in library</span><br
style="font-family:courier new,monospace;" /></div></div><div style="margin-left: 40px;"><div style="margin-left:
40px;"><spanstyle="font-family: courier new,monospace;">Warning: 'getaddrinfo' not found in library</span><br
style="font-family:courier new,monospace;" /><span style="font-family: courier new,monospace;">Warning: 'pgstrcasecmp'
notfound in library</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier
new,monospace;">Warning:'thread' not found in library</span><br style="font-family: courier new,monospace;" /><span
style="font-family:courier new,monospace;">Warning: 'inet_aton' not found in library</span><br style="font-family:
couriernew,monospace;" /><span style="font-family: courier new,monospace;">Warning: 'crypt' not found in
library</span><brstyle="font-family: courier new,monospace;" /><span style="font-family: courier
new,monospace;">Warning:'noblock' not found in library</span><br style="font-family: courier new,monospace;" /><span
style="font-family:courier new,monospace;">Warning: 'md5' not found in library</span><br style="font-family: courier
new,monospace;"/><span style="font-family: courier new,monospace;">Warning: 'ip' not found in library</span><br
style="font-family:courier new,monospace;" /><span style="font-family: courier new,monospace;">Warning: 'fe-auth' not
foundin library</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier
new,monospace;">Warning:'fe-protocol2' not found in library</span><br style="font-family: courier new,monospace;"
/><spanstyle="font-family: courier new,monospace;">Warning: 'fe-protocol3' not found in library</span><br
style="font-family:courier new,monospace;" /><span style="font-family: courier new,monospace;">Warning: 'fe-connect'
notfound in library</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier
new,monospace;">Warning:'fe-exec' not found in library</span><br style="font-family: courier new,monospace;" /><span
style="font-family:courier new,monospace;">Warning: 'fe-lobj' not found in library</span><br style="font-family:
couriernew,monospace;" /><span style="font-family: courier new,monospace;">Warning: 'fe-misc' not found in
library</span><brstyle="font-family: courier new,monospace;" /><span style="font-family: courier
new,monospace;">Warning:public '_pqFlush' in module 'fe-misc' clashes with prior module 'fe-exe</span><span
style="font-family:courier new,monospace;">c'</span><br style="font-family: courier new,monospace;" /><span
style="font-family:courier new,monospace;">Warning: 'fe-print' not found in library</span><br style="font-family:
couriernew,monospace;" /><span style="font-family: courier new,monospace;">Warning: 'fe-secure' not found in
library</span><brstyle="font-family: courier new,monospace;" /><span style="font-family: courier
new,monospace;">Warning:'pqexpbuffer' not found in library</span><br style="font-family: courier new,monospace;"
/><spanstyle="font-family: courier new,monospace;">Warning: 'pqsignal' not found in library</span><br
style="font-family:courier new,monospace;" /><span style="font-family: courier new,monospace;">Warning: 'wchar' not
foundin library</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier
new,monospace;">Warning:'encnames' not found in library</span><br style="font-family: courier new,monospace;" /><span
style="font-family:courier new,monospace;">Warning: 'snprintf' not found in library</span><br style="font-family:
couriernew,monospace;" /><span style="font-family: courier new,monospace;">Warning: 'strlcpy' not found in
library</span><brstyle="font-family: courier new,monospace;" /><span style="font-family: courier
new,monospace;">Warning:'pthread-win32' not found in library</span><br style="font-family: courier new,monospace;"
/><spanstyle="font-family: courier new,monospace;">Warning: '' not found in library</span><br style="font-family:
couriernew,monospace;" /><span style="font-family: courier new,monospace;">Warning: '.OBJ' file not found</span><br
style="font-family:courier new,monospace;" /><span style="font-family: courier new,monospace;">        brcc32.exe -l
0x409-iC:\Borland\BCC55\include -fo".\Release\libpq.res"</span><br style="font-family: courier new,monospace;" /><span
style="font-family:courier new,monospace;">libpq.rc</span><br style="font-family: courier new,monospace;" /><span
style="font-family:courier new,monospace;">Borland Resource Compiler  Version 5.40</span><br style="font-family:
couriernew,monospace;" /><span style="font-family: courier new,monospace;">Copyright (c) 1990, 1999 Inprise
Corporation. All rights reserved.</span><br style="font-family: courier new,monospace;" /><span style="font-family:
couriernew,monospace;">        ilink32.exe @MAKE0000.@@@</span><br style="font-family: courier new,monospace;" /><span
style="font-family:courier new,monospace;">Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland</span><br
style="font-family:courier new,monospace;" /><span style="font-family: courier new,monospace;">Error: Unresolved
external'_pgwin32_safestat' referenced from C:\SOURCE POSTGRES 8.3\SRC\INTERFACES\LIBPQ\REL</span><br
style="font-family:courier new,monospace;" /><span style="font-family: courier
new,monospace;">EASE\BLIBPQ.LIB|fe-connect</span><brstyle="font-family: courier new,monospace;" /><br
style="font-family:courier new,monospace;" /><span style="font-family: courier new,monospace;">** error 2 ** deleting
".\Release\blibpq.dll"</span><br/></div><br />He would welcome any suggestions or help<br /><br />Claudio Lezcano<br
/></div></div>

Re: compilig libpq with borland 5.5

From
"Hiroshi Saito"
Date:
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