Re: VC++ psql build broken

"Dave Page" <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.win32,gmane.comp.db.postgresql.devel.patches
Message-ID <E7F85A1B5FF8D44C8A1AF6885BC9A0E4306736@ratbert.vale-housing.co.uk>
 

> -----Original Message-----
> From: Bruce Momjian [mailto:[email protected]] 
> Sent: 27 September 2004 23:58
> To: Dave Page
> Cc: PgSQL Win32 developers; PostgreSQL Patches
> Subject: Re: [pgsql-hackers-win32] VC++ psql build broken
> 
> 
> I have fixed this issue with Dave's help.

Hmm, not entirely it seems. An include path got missed out of the patch
- see the attached fix. This also adds debug build support to
src/bin/psql/win32.mak.

Also:

- The crash I was seeing last night appears to only occur when using
mingw compiled libpq. Using the ones compiled with the VC++ build works
just fine. The Windows installer puts libpq.dll and a couple of SSL libs
in the Windows\System32 directory, so this potentially could cause some
support emails.

Strangely, pgAdmin works OK with my mingw compiled libpq.dll (with an
import lib created from pq.def using VC++'s lib.exe), even though it is
built with VC++ Windows. It crashes with the VC++ compiled libpq.

- Compiling on a clean tree I now get the warnings below (sorry, I must
have forgotten to try a completely clean build in my weary state last
night :-) ):

command.c
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\direct.h(132) : warning C4003: not
enough actual parameters for macro 'mkdir'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(79) : warning C4005:
'SIG_DFL' : macro redefinition
        ..\..\include\port/win32.h(118) : see previous definition of
'SIG_DFL'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(80) : warning C4005:
'SIG_IGN' : macro redefinition
        ..\..\include\port/win32.h(120) : see previous definition of
'SIG_IGN'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(87) : warning C4005:
'SIG_ERR' : macro redefinition
        ..\..\include\port/win32.h(119) : see previous definition of
'SIG_ERR'
common.c
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(79) : warning C4005:
'SIG_DFL' : macro redefinition
        ..\..\include\port/win32.h(118) : see previous definition of
'SIG_DFL'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(80) : warning C4005:
'SIG_IGN' : macro redefinition
        ..\..\include\port/win32.h(120) : see previous definition of
'SIG_IGN'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(87) : warning C4005:
'SIG_ERR' : macro redefinition
        ..\..\include\port/win32.h(119) : see previous definition of
'SIG_ERR'
common.c(536) : warning C4018: '<' : signed/unsigned mismatch
copy.c
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(79) : warning C4005:
'SIG_DFL' : macro redefinition
        ..\..\include\port/win32.h(118) : see previous definition of
'SIG_DFL'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(80) : warning C4005:
'SIG_IGN' : macro redefinition
        ..\..\include\port/win32.h(120) : see previous definition of
'SIG_IGN'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(87) : warning C4005:
'SIG_ERR' : macro redefinition
        ..\..\include\port/win32.h(119) : see previous definition of
'SIG_ERR'
describe.c
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(79) : warning C4005:
'SIG_DFL' : macro redefinition
        ..\..\include\port/win32.h(118) : see previous definition of
'SIG_DFL'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(80) : warning C4005:
'SIG_IGN' : macro redefinition
        ..\..\include\port/win32.h(120) : see previous definition of
'SIG_IGN'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(87) : warning C4005:
'SIG_ERR' : macro redefinition
        ..\..\include\port/win32.h(119) : see previous definition of
'SIG_ERR'
help.c
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(79) : warning C4005:
'SIG_DFL' : macro redefinition
        ..\..\include\port/win32.h(118) : see previous definition of
'SIG_DFL'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(80) : warning C4005:
'SIG_IGN' : macro redefinition
        ..\..\include\port/win32.h(120) : see previous definition of
'SIG_IGN'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(87) : warning C4005:
'SIG_ERR' : macro redefinition
        ..\..\include\port/win32.h(119) : see previous definition of
'SIG_ERR'
input.c
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(79) : warning C4005:
'SIG_DFL' : macro redefinition
        ..\..\include\port/win32.h(118) : see previous definition of
'SIG_DFL'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(80) : warning C4005:
'SIG_IGN' : macro redefinition
        ..\..\include\port/win32.h(120) : see previous definition of
'SIG_IGN'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(87) : warning C4005:
'SIG_ERR' : macro redefinition
        ..\..\include\port/win32.h(119) : see previous definition of
'SIG_ERR'
large_obj.c
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(79) : warning C4005:
'SIG_DFL' : macro redefinition
        ..\..\include\port/win32.h(118) : see previous definition of
'SIG_DFL'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(80) : warning C4005:
'SIG_IGN' : macro redefinition
        ..\..\include\port/win32.h(120) : see previous definition of
'SIG_IGN'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(87) : warning C4005:
'SIG_ERR' : macro redefinition
        ..\..\include\port/win32.h(119) : see previous definition of
'SIG_ERR'
mainloop.c
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(79) : warning C4005:
'SIG_DFL' : macro redefinition
        ..\..\include\port/win32.h(118) : see previous definition of
'SIG_DFL'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(80) : warning C4005:
'SIG_IGN' : macr
o redefinition
        ..\..\include\port/win32.h(120) : see previous definition of
'SIG_IGN'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(87) : warning C4005:
'SIG_ERR' : macro redefinition
        ..\..\include\port/win32.h(119) : see previous definition of
'SIG_ERR'
mainloop.c(253) : warning C4018: '==' : signed/unsigned mismatch
mbprint.c
print.c
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(79) : warning C4005:
'SIG_DFL' : macro redefinition
        ..\..\include\port/win32.h(118) : see previous definition of
'SIG_DFL'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(80) : warning C4005:
'SIG_IGN' : macro redefinition
        ..\..\include\port/win32.h(120) : see previous definition of
'SIG_IGN'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(87) : warning C4005:
'SIG_ERR' : macro redefinition
        ..\..\include\port/win32.h(119) : see previous definition of
'SIG_ERR'
print.c(1238) : warning C4090: 'function' : different 'const' qualifiers
print.c(1238) : warning C4022: 'free' : pointer mismatch for actual
parameter 1
print.c(1239) : warning C4090: 'function' : different 'const' qualifiers
print.c(1239) : warning C4022: 'free' : pointer mismatch for actual
parameter 1
prompt.c
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(79) : warning C4005:
'SIG_DFL' : macro redefinition
        ..\..\include\port/win32.h(118) : see previous definition of
'SIG_DFL'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(80) : warning C4005:
'SIG_IGN' : macro redefinition
        ..\..\include\port/win32.h(120) : see previous definition of
'SIG_IGN'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(87) : warning C4005:
'SIG_ERR' : macro redefinition
        ..\..\include\port/win32.h(119) : see previous definition of
'SIG_ERR'
psqlscan.c
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(79) : warning C4005:
'SIG_DFL' : macro redefinition
        ..\..\include\port/win32.h(118) : see previous definition of
'SIG_DFL'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(80) : warning C4005:
'SIG_IGN' : macr
o redefinition
        ..\..\include\port/win32.h(120) : see previous definition of
'SIG_IGN'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(87) : warning C4005:
'SIG_ERR' : macr
o redefinition
        ..\..\include\port/win32.h(119) : see previous definition of
'SIG_ERR'
startup.c
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(79) : warning C4005:
'SIG_DFL' : macro redefinition
        ..\..\include\port/win32.h(118) : see previous definition of
'SIG_DFL'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(80) : warning C4005:
'SIG_IGN' : macro redefinition
        ..\..\include\port/win32.h(120) : see previous definition of
'SIG_IGN'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(87) : warning C4005:
'SIG_ERR' : macro redefinition
        ..\..\include\port/win32.h(119) : see previous definition of
'SIG_ERR'
stringutils.c
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(79) : warning C4005:
'SIG_DFL' : macro redefinition
        ..\..\include\port/win32.h(118) : see previous definition of
'SIG_DFL'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(80) : warning C4005:
'SIG_IGN' : macro redefinition
        ..\..\include\port/win32.h(120) : see previous definition of
'SIG_IGN'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(87) : warning C4005:
'SIG_ERR' : macro redefinition
        ..\..\include\port/win32.h(119) : see previous definition of
'SIG_ERR'
tab-complete.c
variables.c
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(79) : warning C4005:
'SIG_DFL' : macro redefinition
        ..\..\include\port/win32.h(118) : see previous definition of
'SIG_DFL'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(80) : warning C4005:
'SIG_IGN' : macr
o redefinition
        ..\..\include\port/win32.h(120) : see previous definition of
'SIG_IGN'
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\signal.h(87) : warning C4005:
'SIG_ERR' : macro redefinition
        ..\..\include\port/win32.h(119) : see previous definition of
'SIG_ERR'
        link.exe @C:\DOCUME~1\dpage\LOCALS~1\Temp\nmh02044.
        cd ..\..
        echo All Win32 parts have been built!
All Win32 parts have been built!

Regards, Dave


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
win32.diff (application/octet-stream, 3 KB)
Index: src/bin/psql/bcc32.mak
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/bin/psql/bcc32.mak,v
retrieving revision 1.11
diff -u -r1.11 bcc32.mak
--- src/bin/psql/bcc32.mak	27 Sep 2004 22:20:40 -0000	1.11
+++ src/bin/psql/bcc32.mak	28 Sep 2004 10:43:16 -0000
@@ -103,8 +103,9 @@
 USERDEFINES = WIN32;_CONSOLE;_MBCS;HAVE_STRDUP
 
 # ---------------------------------------------------------------------------
-CPP_PROJ = -I$(BCB)\include;..\..\include;..\..\interfaces\libpq -c -D$(USERDEFINES) -DFRONTEND \
-           -tWM -tWC -q -5 -a8 -pc -X -w-use -w-par -w-pia -w-csu -w-aus -w-ccc
+CPP_PROJ = -I$(BCB)\include;..\..\include;..\..\interfaces\libpq;..\..\include\port\win32 \
+           -c -D$(USERDEFINES) -DFRONTEND -tWM -tWC -q -5 -a8 -pc -X -w-use -w-par -w-pia \
+	   -w-csu -w-aus -w-ccc
 
 !IFDEF DEBUG
 CPP_PROJ  	= $(CPP_PROJ) -Od -r- -k -v -y -vi- -D_DEBUG
Index: src/bin/psql/win32.mak
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/bin/psql/win32.mak,v
retrieving revision 1.24
diff -u -r1.24 win32.mak
--- src/bin/psql/win32.mak	27 Sep 2004 22:20:40 -0000	1.24
+++ src/bin/psql/win32.mak	28 Sep 2004 10:43:16 -0000
@@ -10,12 +10,21 @@
 PERL=perl.exe
 FLEX=flex.exe
 
+!IFDEF DEBUG
+OPT=/Od /Zi /MDd
+LOPT=/DEBUG
+DEBUGDEF=/D _DEBUG
+OUTDIR=.\Debug
+INTDIR=.\Debug
+!ELSE
+OPT=/O2 /MD
+LOPT=
+DEBUGDEF=/D NDEBUG
 OUTDIR=.\Release
 INTDIR=.\Release
+!ENDIF
+
 REFDOCDIR= ../../../doc/src/sgml/ref
-# Begin Custom Macros
-OutDir=.\Release
-# End Custom Macros
 
 ALL : sql_help.h psqlscan.c "..\..\port\pg_config_paths.h" "$(OUTDIR)\psql.exe"
 
@@ -60,18 +69,19 @@
 "$(OUTDIR)" :
     if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
 
-CPP_PROJ=/nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D\
+CPP_PROJ=/nologo $(OPT) /W3 /GX /D "WIN32" $(DEBUGDEF) /D "_CONSOLE" /D\
  "_MBCS" /Fp"$(INTDIR)\psql.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c \
- /I ..\..\include /I ..\..\interfaces\libpq /D "HAVE_STRDUP" /D "FRONTEND"
+ /I ..\..\include /I ..\..\interfaces\libpq /I ..\..\include\port\win32 \
+ /D "HAVE_STRDUP" /D "FRONTEND"
 
-CPP_OBJS=.\Release/
+CPP_OBJS=$(INTDIR)/
 CPP_SBRS=.
 
 LINK32=link.exe
 LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
  advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
  odbccp32.lib wsock32.lib /nologo /subsystem:console /incremental:no\
- /pdb:"$(OUTDIR)\psql.pdb" /machine:I386 /out:"$(OUTDIR)\psql.exe" 
+ /pdb:"$(OUTDIR)\psql.pdb" /machine:I386 $(LOPT) /out:"$(OUTDIR)\psql.exe" 
 LINK32_OBJS= \
 	"$(INTDIR)\command.obj" \
 	"$(INTDIR)\common.obj" \
@@ -95,7 +105,11 @@
 	"$(INTDIR)\path.obj" \
 	"$(INTDIR)\pgstrcasecmp.obj" \
 	"$(INTDIR)\sprompt.obj" \
+!IFDEF DEBUG
+	"..\..\interfaces\libpq\Debug\libpqddll.lib"
+!ELSE
 	"..\..\interfaces\libpq\Release\libpqdll.lib"
+!ENDIF
 
 "$(OUTDIR)\psql.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
     $(LINK32) @<<
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.