agora inbox for pgsql-interfaces@postgresql.org
help / color / mirror / Atom feedlibpq on windows
26+ messages / 12 participants
[nested] [flat]
* libpq on windows
@ 2001-06-28 08:56 "Jean-Sébastien ANDUJAR" <jandujar@transiciel.com>
0 siblings, 0 replies; 26+ messages in thread
From: "Jean-Sébastien ANDUJAR" @ 2001-06-28 08:56 UTC (permalink / raw)
To: pgsql-interfaces
Can you send me the interface library "libpq" compile for windows.
Many Thanks, Jean Sé
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
Jean-Sébastien ANDUJAR
mailto:jandujar@transiciel.com
http://www.transiciel.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
^ permalink raw reply [nested|flat] 26+ messages in thread
* libpq on windows
@ 2001-06-28 09:21 "Jean-Sébastien ANDUJAR" <jandujar@transiciel.com>
0 siblings, 0 replies; 26+ messages in thread
From: "Jean-Sébastien ANDUJAR" @ 2001-06-28 09:21 UTC (permalink / raw)
To: pgsql-interfaces
Can you send me the interface library "libpq" compile for windows.
Many Thanks, Jean Sé
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
Jean-Sébastien ANDUJAR
mailto:jandujar@transiciel.com
http://www.transiciel.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
^ permalink raw reply [nested|flat] 26+ messages in thread
* libpq++ on Windows
@ 2001-06-30 17:37 Christian Ullrich <chris@chrullrich.de>
2001-06-30 19:35 ` Re: libpq++ on Windows jtv <jtv@xs4all.nl>
2001-07-01 00:11 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
0 siblings, 2 replies; 26+ messages in thread
From: Christian Ullrich @ 2001-06-30 17:37 UTC (permalink / raw)
To: pgsql-interfaces
Hello!
I've read a lot about major changes in libpq++ in 7.2 or later.
As I just got it to compile and work (at least as far as
connecting and executing a single query, at which point I stopped
testing) with VC++ 6, I would like to know if the future code will
still build and run with Microsoft's compilers.
BTW, why isn't libpq++ built from win32.mak, along with libpq?
--
Christian Ullrich Registrierter Linux-User #125183
"Sie können nach R'ed'mond fliegen -- aber Sie werden sterben"
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq++ on Windows
2001-06-30 17:37 libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
@ 2001-06-30 19:35 ` jtv <jtv@xs4all.nl>
1 sibling, 0 replies; 26+ messages in thread
From: jtv @ 2001-06-30 19:35 UTC (permalink / raw)
To: pgsql-interfaces
On Sat, Jun 30, 2001 at 07:37:30PM +0200, Christian Ullrich wrote:
>
> I've read a lot about major changes in libpq++ in 7.2 or later.
I'm planning a completely new front-end that comes a lot closer to the way
libraries want to be in C++ (eg. intense use of templates, and conformance
to the STL). The main obstacle ATM is getting Debian up to speed on my
Powerbook, esp. its modem.
> As I just got it to compile and work (at least as far as
> connecting and executing a single query, at which point I stopped
> testing) with VC++ 6, I would like to know if the future code will
> still build and run with Microsoft's compilers.
Hopefully. But as always, your feedback will be essential to make that
possible!
Of course it would depend on exactly which version of the compiler you're
interested in. IIRC version 5 has some bugs that might be so difficult to
work around as to effectively require a separate code base and interface.
That would be a good reason to still maintain the existing library as well,
I think.
Jeroen
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq++ on Windows
2001-06-30 17:37 libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
@ 2001-07-01 00:11 ` Peter Eisentraut <peter_e@gmx.net>
2001-07-01 07:48 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
1 sibling, 1 reply; 26+ messages in thread
From: Peter Eisentraut @ 2001-07-01 00:11 UTC (permalink / raw)
To: Christian Ullrich <chris@chrullrich.de>; +Cc: pgsql-interfaces
Christian Ullrich writes:
> BTW, why isn't libpq++ built from win32.mak, along with libpq?
Because no one has invested the effort to make that happen, yet. If you
know how to write these .mak files then feel free to share your findings.
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq++ on Windows
2001-06-30 17:37 libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 00:11 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
@ 2001-07-01 07:48 ` Christian Ullrich <chris@chrullrich.de>
2001-07-01 15:45 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
0 siblings, 1 reply; 26+ messages in thread
From: Christian Ullrich @ 2001-07-01 07:48 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-interfaces
* Peter Eisentraut wrote on Sunday, 01.07.2001:
> Christian Ullrich writes:
>
> > BTW, why isn't libpq++ built from win32.mak, along with libpq?
>
> Because no one has invested the effort to make that happen, yet. If you
> know how to write these .mak files then feel free to share your findings.
I will look into it. It should be enough to get it to work via the
GUI and export a Makefile (I wonder how they dare to call these
things Makefiles). I'll report back later today, European time.
--
Christian Ullrich Registrierter Linux-User #125183
"Sie können nach R'ed'mond fliegen -- aber Sie werden sterben"
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq++ on Windows
2001-06-30 17:37 libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 00:11 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
2001-07-01 07:48 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
@ 2001-07-01 15:45 ` Christian Ullrich <chris@chrullrich.de>
2001-07-01 18:28 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
0 siblings, 1 reply; 26+ messages in thread
From: Christian Ullrich @ 2001-07-01 15:45 UTC (permalink / raw)
To: pgsql-interfaces
* Christian Ullrich wrote on Sunday, 2001-07-01:
> I will look into it. It should be enough to get it to work via the
> GUI and export a Makefile (I wonder how they dare to call these
Well, I found it was easier to adapt the win32.mak for libpq.
So here is the patch.
Notes:
- The additions to config.h.in and config.h.win32 are not very elegant,
especially config.h.in. But I need to export the classes, and that's
the only way to go.
- The static library doesn't work. It asserts while connecting.
I've tried to find the bug, but failed miserably.
WSAStartup() returned success, so that shouldn't be the reason.
- The filenames are constructed like libpq's:
- libpq++.dll: The working DLL.
- libpq++.lib. The broken static library.
- libpq++dll.lib: The DLL's import library.
Goodbye.
--
Christian Ullrich Registrierter Linux-User #125183
"Sie können nach R'ed'mond fliegen -- aber Sie werden sterben"
diff -urN postgresql-7.1.2.orig/src/include/config.h.in postgresql-7.1.2/src/include/config.h.in
--- postgresql-7.1.2.orig/src/include/config.h.in Sat Apr 14 22:55:02 2001
+++ postgresql-7.1.2/src/include/config.h.in Sun Jul 1 15:21:26 2001
@@ -675,6 +675,13 @@
#include "os.h"
+/*
+ * The libpq++ headers need this for Win32 native DLL build with MSVC.
+ * Win32/Cygwin and Unix builds don't.
+ */
+
+#define DLLAPI
+
/*
* The following is used as the arg list for signal handlers. Any ports
* that take something other than an int argument should override this in
diff -urN postgresql-7.1.2.orig/src/include/config.h.win32 postgresql-7.1.2/src/include/config.h.win32
--- postgresql-7.1.2.orig/src/include/config.h.win32 Fri May 11 01:34:42 2001
+++ postgresql-7.1.2/src/include/config.h.win32 Sun Jul 1 15:21:26 2001
@@ -20,3 +20,13 @@
#define HAVE_ATEXIT
#define HAVE_MEMMOVE
+
+#define HAVE_CXX_STRING_HEADER
+#define HAVE_NAMESPACE_STD
+
+/* This is as good a place as any */
+#ifdef _DLL
+#define DLLAPI __declspec(dllexport)
+#else
+#define DLLAPI __declspec(dllimport)
+#endif /* _DLL */
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/libpq++dll.rc postgresql-7.1.2/src/interfaces/libpq++/libpq++dll.rc
--- postgresql-7.1.2.orig/src/interfaces/libpq++/libpq++dll.rc Thu Jan 1 00:00:00 1970
+++ postgresql-7.1.2/src/interfaces/libpq++/libpq++dll.rc Sun Jul 1 15:21:26 2001
@@ -0,0 +1,34 @@
+#include <winver.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 7,1,2,0
+ PRODUCTVERSION 7,1,2,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x40004L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "\0"
+ VALUE "CompanyName", " \0"
+ VALUE "FileDescription", "PostgreSQL C++ Access Library\0"
+ VALUE "FileVersion", "7, 1, 2, 0\0"
+ VALUE "InternalName", "libpq++\0"
+ VALUE "LegalCopyright", "Copyright © 2000\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "libpq++.dll\0"
+ VALUE "PrivateBuild", "\0"
+ VALUE "ProductName", "PostgreSQL\0"
+ VALUE "ProductVersion", "7, 1, 2, 0\0"
+ VALUE "SpecialBuild", "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pgconnection.h postgresql-7.1.2/src/interfaces/libpq++/pgconnection.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pgconnection.h Sat Feb 10 02:31:30 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pgconnection.h Sun Jul 1 15:21:26 2001
@@ -55,7 +55,7 @@
// This class contains all the information about the connection
// to the backend process. All the database classes should be
// derived from this class to obtain the connection interface.
-class PgConnection {
+class DLLAPI PgConnection {
protected:
PGconn* pgConn; // Connection Structure
PGresult* pgResult; // Current Query Result
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pgcursordb.h postgresql-7.1.2/src/interfaces/libpq++/pgcursordb.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pgcursordb.h Wed Jan 24 19:43:32 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pgcursordb.h Sun Jul 1 15:21:26 2001
@@ -36,7 +36,7 @@
// manipulates data through it. The interface will introduce some
// ease of use through the methods that will allow cursor specific
// operations, like fetch, forward, etc.
-class PgCursor : public PgTransaction {
+class DLLAPI PgCursor : public PgTransaction {
public:
PgCursor(const char* conninfo, const char* cursor); // use reasonable & environment defaults
// connect to the database with given environment and database name
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pgdatabase.h postgresql-7.1.2/src/interfaces/libpq++/pgdatabase.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pgdatabase.h Wed Jan 24 19:43:32 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pgdatabase.h Sun Jul 1 15:21:26 2001
@@ -34,7 +34,7 @@
// This is the basic database access class. Its interface should
// be used only after a query has been sent to the backend and
// results are being received.
-class PgDatabase : public PgConnection {
+class DLLAPI PgDatabase : public PgConnection {
public:
// connect to the database with conninfo
PgDatabase(const char* conninfo) : PgConnection(conninfo) {}
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pglobject.h postgresql-7.1.2/src/interfaces/libpq++/pglobject.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pglobject.h Wed Jan 24 19:43:32 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pglobject.h Sun Jul 1 15:21:26 2001
@@ -29,7 +29,7 @@
// PgLargeObject - a class for accessing Large Object in a database
//
// ****************************************************************
-class PgLargeObject : public PgConnection {
+class DLLAPI PgLargeObject : public PgConnection {
private:
int pgFd;
Oid pgObject;
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pgtransdb.h postgresql-7.1.2/src/interfaces/libpq++/pgtransdb.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pgtransdb.h Wed Jan 24 19:43:32 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pgtransdb.h Sun Jul 1 15:21:26 2001
@@ -34,7 +34,7 @@
// This is the database access class that keeps an open
// transaction block during its lifetime. The block is ENDed when
// the object is destroyed.
-class PgTransaction : public PgDatabase {
+class DLLAPI PgTransaction : public PgDatabase {
public:
PgTransaction(const char* conninfo); // use reasonable & environment defaults
// connect to the database with given environment and database name
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/win32.mak postgresql-7.1.2/src/interfaces/libpq++/win32.mak
--- postgresql-7.1.2.orig/src/interfaces/libpq++/win32.mak Thu Jan 1 00:00:00 1970
+++ postgresql-7.1.2/src/interfaces/libpq++/win32.mak Sun Jul 1 15:21:26 2001
@@ -0,0 +1,126 @@
+# Makefile for Microsoft Visual C++ 6.0 (or compat)
+
+# Will build a Win32 static library (non-debug) libpq++.lib
+# and a Win32 dynamic library (non-debug) libpq++.dll with import library libpq++dll.lib
+
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+.SUFFIXES : .cc
+
+CPP=cl.exe
+RSC=rc.exe
+
+OUTDIR=.\Release
+INTDIR=.\Release
+# Begin Custom Macros
+OutDir=.\Release
+# End Custom Macros
+
+ALL : "$(OUTDIR)\libpq++.dll" "$(OUTDIR)\libpq++.lib"
+
+CLEAN :
+ -@erase "$(INTDIR)\pgconnection.obj"
+ -@erase "$(INTDIR)\pgcursordb.obj"
+ -@erase "$(INTDIR)\pgdatabase.obj"
+ -@erase "$(INTDIR)\pglobject.obj"
+ -@erase "$(INTDIR)\pgtransdb.obj"
+ -@erase "$(OUTDIR)\libpq++.lib"
+ -@erase "$(OUTDIR)\libpq++.dll"
+ -@erase "$(OUTDIR)\libpq++dll.exp"
+ -@erase "$(OUTDIR)\libpq++dll.lib"
+ -@erase "$(OUTDIR)\libpq++dll.res"
+ -@erase "*.pch"
+ -@erase "$(OUTDIR)\libpq++.pch"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /TP /MD /W3 /GX /O2 /I "..\..\include" /I "..\libpq" /D "NDEBUG" /D\
+ "WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\libpq++.pch" /YX\
+ /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c /D "HAVE_VSNPRINTF" /D "HAVE_STRDUP"
+
+CPP_OBJS=.\Release/
+CPP_SBRS=.
+
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\libpq++.lib"
+LIB32_OBJS= \
+ "$(OUTDIR)\pgconnection.obj" \
+ "$(OUTDIR)\pgcursordb.obj" \
+ "$(OUTDIR)\pgdatabase.obj" \
+ "$(OUTDIR)\pglobject.obj" \
+ "$(OUTDIR)\pgtransdb.obj"
+
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\libpq++dll.res"
+
+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 wsock32.lib\
+ odbccp32.lib libpq.lib msvcrt.lib /nologo /subsystem:windows /dll /incremental:no\
+ /pdb:"$(OUTDIR)\libpq++.pdb" /machine:I386 /out:"$(OUTDIR)\libpq++.dll"\
+ /implib:"$(OUTDIR)\libpq++dll.lib" /libpath:"..\libpq\release"
+LINK32_OBJS= \
+ "$(OUTDIR)\pgconnection.obj" \
+ "$(OUTDIR)\pgcursordb.obj" \
+ "$(OUTDIR)\pgdatabase.obj" \
+ "$(OUTDIR)\pglobject.obj" \
+ "$(OUTDIR)\pgtransdb.obj" \
+ "$(OUTDIR)\libpq++dll.res"
+
+"$(INTDIR)\libpq++dll.res" : "$(INTDIR)" libpq++dll.rc
+ $(RSC) $(RSC_PROJ) libpq++dll.rc
+
+"$(OUTDIR)\libpq++.lib" : "$(OUTDIR)" $(LIB32_OBJS)
+ $(LIB32) @<<
+ $(LIB32_FLAGS) $(LIB32_OBJS)
+<<
+
+"$(OUTDIR)\libpq++.dll" : "$(OUTDIR)" $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+.c{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cc{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cc{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
diff -urN postgresql-7.1.2.orig/src/win32.mak postgresql-7.1.2/src/win32.mak
--- postgresql-7.1.2.orig/src/win32.mak Tue Jan 18 19:05:29 2000
+++ postgresql-7.1.2/src/win32.mak Sun Jul 1 15:22:15 2001
@@ -19,6 +19,8 @@
if not exist config.h copy config.h.win32 config.h
cd ..
cd interfaces\libpq
+ nmake /f win32.mak $(MAKEMACRO)
+ cd ..\libpq++
nmake /f win32.mak $(MAKEMACRO)
cd ..\..\bin\psql
nmake /f win32.mak $(MAKEMACRO)
Attachments:
[text/plain] libpq++.diff (9.3K, ../../20010701174549.A976@christian.chrullrich.de/2-libpq++.diff)
download | inline diff:
diff -urN postgresql-7.1.2.orig/src/include/config.h.in postgresql-7.1.2/src/include/config.h.in
--- postgresql-7.1.2.orig/src/include/config.h.in Sat Apr 14 22:55:02 2001
+++ postgresql-7.1.2/src/include/config.h.in Sun Jul 1 15:21:26 2001
@@ -675,6 +675,13 @@
#include "os.h"
+/*
+ * The libpq++ headers need this for Win32 native DLL build with MSVC.
+ * Win32/Cygwin and Unix builds don't.
+ */
+
+#define DLLAPI
+
/*
* The following is used as the arg list for signal handlers. Any ports
* that take something other than an int argument should override this in
diff -urN postgresql-7.1.2.orig/src/include/config.h.win32 postgresql-7.1.2/src/include/config.h.win32
--- postgresql-7.1.2.orig/src/include/config.h.win32 Fri May 11 01:34:42 2001
+++ postgresql-7.1.2/src/include/config.h.win32 Sun Jul 1 15:21:26 2001
@@ -20,3 +20,13 @@
#define HAVE_ATEXIT
#define HAVE_MEMMOVE
+
+#define HAVE_CXX_STRING_HEADER
+#define HAVE_NAMESPACE_STD
+
+/* This is as good a place as any */
+#ifdef _DLL
+#define DLLAPI __declspec(dllexport)
+#else
+#define DLLAPI __declspec(dllimport)
+#endif /* _DLL */
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/libpq++dll.rc postgresql-7.1.2/src/interfaces/libpq++/libpq++dll.rc
--- postgresql-7.1.2.orig/src/interfaces/libpq++/libpq++dll.rc Thu Jan 1 00:00:00 1970
+++ postgresql-7.1.2/src/interfaces/libpq++/libpq++dll.rc Sun Jul 1 15:21:26 2001
@@ -0,0 +1,34 @@
+#include <winver.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 7,1,2,0
+ PRODUCTVERSION 7,1,2,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x40004L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "\0"
+ VALUE "CompanyName", " \0"
+ VALUE "FileDescription", "PostgreSQL C++ Access Library\0"
+ VALUE "FileVersion", "7, 1, 2, 0\0"
+ VALUE "InternalName", "libpq++\0"
+ VALUE "LegalCopyright", "Copyright © 2000\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "libpq++.dll\0"
+ VALUE "PrivateBuild", "\0"
+ VALUE "ProductName", "PostgreSQL\0"
+ VALUE "ProductVersion", "7, 1, 2, 0\0"
+ VALUE "SpecialBuild", "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pgconnection.h postgresql-7.1.2/src/interfaces/libpq++/pgconnection.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pgconnection.h Sat Feb 10 02:31:30 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pgconnection.h Sun Jul 1 15:21:26 2001
@@ -55,7 +55,7 @@
// This class contains all the information about the connection
// to the backend process. All the database classes should be
// derived from this class to obtain the connection interface.
-class PgConnection {
+class DLLAPI PgConnection {
protected:
PGconn* pgConn; // Connection Structure
PGresult* pgResult; // Current Query Result
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pgcursordb.h postgresql-7.1.2/src/interfaces/libpq++/pgcursordb.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pgcursordb.h Wed Jan 24 19:43:32 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pgcursordb.h Sun Jul 1 15:21:26 2001
@@ -36,7 +36,7 @@
// manipulates data through it. The interface will introduce some
// ease of use through the methods that will allow cursor specific
// operations, like fetch, forward, etc.
-class PgCursor : public PgTransaction {
+class DLLAPI PgCursor : public PgTransaction {
public:
PgCursor(const char* conninfo, const char* cursor); // use reasonable & environment defaults
// connect to the database with given environment and database name
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pgdatabase.h postgresql-7.1.2/src/interfaces/libpq++/pgdatabase.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pgdatabase.h Wed Jan 24 19:43:32 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pgdatabase.h Sun Jul 1 15:21:26 2001
@@ -34,7 +34,7 @@
// This is the basic database access class. Its interface should
// be used only after a query has been sent to the backend and
// results are being received.
-class PgDatabase : public PgConnection {
+class DLLAPI PgDatabase : public PgConnection {
public:
// connect to the database with conninfo
PgDatabase(const char* conninfo) : PgConnection(conninfo) {}
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pglobject.h postgresql-7.1.2/src/interfaces/libpq++/pglobject.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pglobject.h Wed Jan 24 19:43:32 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pglobject.h Sun Jul 1 15:21:26 2001
@@ -29,7 +29,7 @@
// PgLargeObject - a class for accessing Large Object in a database
//
// ****************************************************************
-class PgLargeObject : public PgConnection {
+class DLLAPI PgLargeObject : public PgConnection {
private:
int pgFd;
Oid pgObject;
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pgtransdb.h postgresql-7.1.2/src/interfaces/libpq++/pgtransdb.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pgtransdb.h Wed Jan 24 19:43:32 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pgtransdb.h Sun Jul 1 15:21:26 2001
@@ -34,7 +34,7 @@
// This is the database access class that keeps an open
// transaction block during its lifetime. The block is ENDed when
// the object is destroyed.
-class PgTransaction : public PgDatabase {
+class DLLAPI PgTransaction : public PgDatabase {
public:
PgTransaction(const char* conninfo); // use reasonable & environment defaults
// connect to the database with given environment and database name
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/win32.mak postgresql-7.1.2/src/interfaces/libpq++/win32.mak
--- postgresql-7.1.2.orig/src/interfaces/libpq++/win32.mak Thu Jan 1 00:00:00 1970
+++ postgresql-7.1.2/src/interfaces/libpq++/win32.mak Sun Jul 1 15:21:26 2001
@@ -0,0 +1,126 @@
+# Makefile for Microsoft Visual C++ 6.0 (or compat)
+
+# Will build a Win32 static library (non-debug) libpq++.lib
+# and a Win32 dynamic library (non-debug) libpq++.dll with import library libpq++dll.lib
+
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+.SUFFIXES : .cc
+
+CPP=cl.exe
+RSC=rc.exe
+
+OUTDIR=.\Release
+INTDIR=.\Release
+# Begin Custom Macros
+OutDir=.\Release
+# End Custom Macros
+
+ALL : "$(OUTDIR)\libpq++.dll" "$(OUTDIR)\libpq++.lib"
+
+CLEAN :
+ -@erase "$(INTDIR)\pgconnection.obj"
+ -@erase "$(INTDIR)\pgcursordb.obj"
+ -@erase "$(INTDIR)\pgdatabase.obj"
+ -@erase "$(INTDIR)\pglobject.obj"
+ -@erase "$(INTDIR)\pgtransdb.obj"
+ -@erase "$(OUTDIR)\libpq++.lib"
+ -@erase "$(OUTDIR)\libpq++.dll"
+ -@erase "$(OUTDIR)\libpq++dll.exp"
+ -@erase "$(OUTDIR)\libpq++dll.lib"
+ -@erase "$(OUTDIR)\libpq++dll.res"
+ -@erase "*.pch"
+ -@erase "$(OUTDIR)\libpq++.pch"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /TP /MD /W3 /GX /O2 /I "..\..\include" /I "..\libpq" /D "NDEBUG" /D\
+ "WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\libpq++.pch" /YX\
+ /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c /D "HAVE_VSNPRINTF" /D "HAVE_STRDUP"
+
+CPP_OBJS=.\Release/
+CPP_SBRS=.
+
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\libpq++.lib"
+LIB32_OBJS= \
+ "$(OUTDIR)\pgconnection.obj" \
+ "$(OUTDIR)\pgcursordb.obj" \
+ "$(OUTDIR)\pgdatabase.obj" \
+ "$(OUTDIR)\pglobject.obj" \
+ "$(OUTDIR)\pgtransdb.obj"
+
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\libpq++dll.res"
+
+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 wsock32.lib\
+ odbccp32.lib libpq.lib msvcrt.lib /nologo /subsystem:windows /dll /incremental:no\
+ /pdb:"$(OUTDIR)\libpq++.pdb" /machine:I386 /out:"$(OUTDIR)\libpq++.dll"\
+ /implib:"$(OUTDIR)\libpq++dll.lib" /libpath:"..\libpq\release"
+LINK32_OBJS= \
+ "$(OUTDIR)\pgconnection.obj" \
+ "$(OUTDIR)\pgcursordb.obj" \
+ "$(OUTDIR)\pgdatabase.obj" \
+ "$(OUTDIR)\pglobject.obj" \
+ "$(OUTDIR)\pgtransdb.obj" \
+ "$(OUTDIR)\libpq++dll.res"
+
+"$(INTDIR)\libpq++dll.res" : "$(INTDIR)" libpq++dll.rc
+ $(RSC) $(RSC_PROJ) libpq++dll.rc
+
+"$(OUTDIR)\libpq++.lib" : "$(OUTDIR)" $(LIB32_OBJS)
+ $(LIB32) @<<
+ $(LIB32_FLAGS) $(LIB32_OBJS)
+<<
+
+"$(OUTDIR)\libpq++.dll" : "$(OUTDIR)" $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+.c{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cc{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cc{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
diff -urN postgresql-7.1.2.orig/src/win32.mak postgresql-7.1.2/src/win32.mak
--- postgresql-7.1.2.orig/src/win32.mak Tue Jan 18 19:05:29 2000
+++ postgresql-7.1.2/src/win32.mak Sun Jul 1 15:22:15 2001
@@ -19,6 +19,8 @@
if not exist config.h copy config.h.win32 config.h
cd ..
cd interfaces\libpq
+ nmake /f win32.mak $(MAKEMACRO)
+ cd ..\libpq++
nmake /f win32.mak $(MAKEMACRO)
cd ..\..\bin\psql
nmake /f win32.mak $(MAKEMACRO)
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq++ on Windows
2001-06-30 17:37 libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 00:11 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
2001-07-01 07:48 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 15:45 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
@ 2001-07-01 18:28 ` Peter Eisentraut <peter_e@gmx.net>
2001-07-01 22:23 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
0 siblings, 1 reply; 26+ messages in thread
From: Peter Eisentraut @ 2001-07-01 18:28 UTC (permalink / raw)
To: Christian Ullrich <chris@chrullrich.de>; +Cc: pgsql-interfaces
Christian Ullrich writes:
> - The additions to config.h.in and config.h.win32 are not very elegant,
> especially config.h.in. But I need to export the classes, and that's
> the only way to go.
Why not put the addition to config.h.in into config.h.win32? When doing a
native Win32 build config.h.in isn't used anyway.
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq++ on Windows
2001-06-30 17:37 libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 00:11 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
2001-07-01 07:48 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 15:45 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 18:28 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
@ 2001-07-01 22:23 ` Christian Ullrich <chris@chrullrich.de>
2001-07-02 04:21 ` Re: libpq++ on Windows Tom Lane <tgl@sss.pgh.pa.us>
2001-07-02 17:56 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
0 siblings, 2 replies; 26+ messages in thread
From: Christian Ullrich @ 2001-07-01 22:23 UTC (permalink / raw)
To: pgsql-interfaces
* Peter Eisentraut wrote on Sunday, 2001-07-01:
> Christian Ullrich writes:
>
> > - The additions to config.h.in and config.h.win32 are not very elegant,
> > especially config.h.in. But I need to export the classes, and that's
> > the only way to go.
>
> Why not put the addition to config.h.in into config.h.win32? When doing a
> native Win32 build config.h.in isn't used anyway.
Because the '#define DLLAPI' in config.h.in -- from which the
config.h for Unix and Cygwin/Win32 builds is generated -- is
necessary to make the compiler happy about the modifications
to the class declarations.
When building the DLL with MSVC I need to export the classes,
and I don't think I can do that with .DEF files, so I must
put __declspec(dllexport) into the class declarations. But
because gcc will choke on them, I define them empty for gcc builds.
--
Christian Ullrich Registrierter Linux-User #125183
"Sie können nach R'ed'mond fliegen -- aber Sie werden sterben"
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq++ on Windows
2001-06-30 17:37 libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 00:11 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
2001-07-01 07:48 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 15:45 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 18:28 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
2001-07-01 22:23 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
@ 2001-07-02 04:21 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-07-02 14:57 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
1 sibling, 1 reply; 26+ messages in thread
From: Tom Lane @ 2001-07-02 04:21 UTC (permalink / raw)
To: Christian Ullrich <chris@chrullrich.de>; +Cc: pgsql-interfaces
Christian Ullrich <chris@chrullrich.de> writes:
> * Peter Eisentraut wrote on Sunday, 2001-07-01:
>> Why not put the addition to config.h.in into config.h.win32? When doing a
>> native Win32 build config.h.in isn't used anyway.
> Because the '#define DLLAPI' in config.h.in -- from which the
> config.h for Unix and Cygwin/Win32 builds is generated -- is
> necessary to make the compiler happy about the modifications
> to the class declarations.
config.h.in is absolutely NOT the right place for platform-specific
defines.
I'd put this in the same category as DLLIMPORT, which is in c.h
(and just as ugly an example of Microsoft cultural imperialism,
but I suppose there's no point in arguing about it).
regards, tom lane
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq++ on Windows
2001-06-30 17:37 libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 00:11 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
2001-07-01 07:48 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 15:45 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 18:28 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
2001-07-01 22:23 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-02 04:21 ` Re: libpq++ on Windows Tom Lane <tgl@sss.pgh.pa.us>
@ 2001-07-02 14:57 ` Christian Ullrich <chris@chrullrich.de>
2001-07-11 22:12 ` Re: libpq++ on Windows Bruce Momjian <pgman@candle.pha.pa.us>
0 siblings, 1 reply; 26+ messages in thread
From: Christian Ullrich @ 2001-07-02 14:57 UTC (permalink / raw)
To: pgsql-interfaces
* Tom Lane wrote on Monday, 2001-07-02:
> config.h.in is absolutely NOT the right place for platform-specific
> defines.
>
> I'd put this in the same category as DLLIMPORT, which is in c.h
> (and just as ugly an example of Microsoft cultural imperialism,
> but I suppose there's no point in arguing about it).
Thanks for the help. You know, if I had looked into c.h in the first
place, I might just have found that out myself.
Here's another patch. It extends the DLLIMPORT declaration
block and allows me to use that same macro in the class headers.
I think it is correctly used there.
--
Christian Ullrich Registrierter Linux-User #125183
"Sie können nach R'ed'mond fliegen -- aber Sie werden sterben"
diff -urN postgresql-7.1.2.orig/src/include/c.h postgresql-7.1.2/src/include/c.h
--- postgresql-7.1.2.orig/src/include/c.h Thu Mar 22 04:00:24 2001
+++ postgresql-7.1.2/src/include/c.h Mon Jul 2 09:35:41 2001
@@ -606,8 +606,14 @@
#else /* not BUILDING_DLL */
#define DLLIMPORT __declspec (dllimport)
#endif
-#else /* not CYGWIN */
-#define DLLIMPORT
+#elif defined(WIN32) && defined(_MSC_VER) /* not CYGWIN */
+#if defined(_DLL)
+#define DLLIMPORT __declspec (dllexport)
+#else /* not _DLL */
+#define DLLIMPORT __declspec (dllimport)
+#endif
+#else /* not CYGWIN, not MSVC */
+#define DLLIMPORT
#endif
/* Provide prototypes for routines not present in a particular machine's
diff -urN postgresql-7.1.2.orig/src/include/config.h.win32 postgresql-7.1.2/src/include/config.h.win32
--- postgresql-7.1.2.orig/src/include/config.h.win32 Fri May 11 01:34:42 2001
+++ postgresql-7.1.2/src/include/config.h.win32 Mon Jul 2 09:28:12 2001
@@ -20,3 +20,6 @@
#define HAVE_ATEXIT
#define HAVE_MEMMOVE
+
+#define HAVE_CXX_STRING_HEADER
+#define HAVE_NAMESPACE_STD
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/libpq++dll.rc postgresql-7.1.2/src/interfaces/libpq++/libpq++dll.rc
--- postgresql-7.1.2.orig/src/interfaces/libpq++/libpq++dll.rc Thu Jan 1 00:00:00 1970
+++ postgresql-7.1.2/src/interfaces/libpq++/libpq++dll.rc Mon Jul 2 09:21:00 2001
@@ -0,0 +1,34 @@
+#include <winver.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 7,1,2,0
+ PRODUCTVERSION 7,1,2,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x40004L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "\0"
+ VALUE "CompanyName", " \0"
+ VALUE "FileDescription", "PostgreSQL C++ Access Library\0"
+ VALUE "FileVersion", "7, 1, 2, 0\0"
+ VALUE "InternalName", "libpq++\0"
+ VALUE "LegalCopyright", "Copyright © 2000\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "libpq++.dll\0"
+ VALUE "PrivateBuild", "\0"
+ VALUE "ProductName", "PostgreSQL\0"
+ VALUE "ProductVersion", "7, 1, 2, 0\0"
+ VALUE "SpecialBuild", "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pgconnection.h postgresql-7.1.2/src/interfaces/libpq++/pgconnection.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pgconnection.h Sat Feb 10 02:31:30 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pgconnection.h Mon Jul 2 09:28:35 2001
@@ -55,7 +55,7 @@
// This class contains all the information about the connection
// to the backend process. All the database classes should be
// derived from this class to obtain the connection interface.
-class PgConnection {
+class DLLIMPORT PgConnection {
protected:
PGconn* pgConn; // Connection Structure
PGresult* pgResult; // Current Query Result
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pgcursordb.h postgresql-7.1.2/src/interfaces/libpq++/pgcursordb.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pgcursordb.h Wed Jan 24 19:43:32 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pgcursordb.h Mon Jul 2 09:28:56 2001
@@ -36,7 +36,7 @@
// manipulates data through it. The interface will introduce some
// ease of use through the methods that will allow cursor specific
// operations, like fetch, forward, etc.
-class PgCursor : public PgTransaction {
+class DLLIMPORT PgCursor : public PgTransaction {
public:
PgCursor(const char* conninfo, const char* cursor); // use reasonable & environment defaults
// connect to the database with given environment and database name
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pgdatabase.h postgresql-7.1.2/src/interfaces/libpq++/pgdatabase.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pgdatabase.h Wed Jan 24 19:43:32 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pgdatabase.h Mon Jul 2 09:28:51 2001
@@ -34,7 +34,7 @@
// This is the basic database access class. Its interface should
// be used only after a query has been sent to the backend and
// results are being received.
-class PgDatabase : public PgConnection {
+class DLLIMPORT PgDatabase : public PgConnection {
public:
// connect to the database with conninfo
PgDatabase(const char* conninfo) : PgConnection(conninfo) {}
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pglobject.h postgresql-7.1.2/src/interfaces/libpq++/pglobject.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pglobject.h Wed Jan 24 19:43:32 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pglobject.h Mon Jul 2 09:28:44 2001
@@ -29,7 +29,7 @@
// PgLargeObject - a class for accessing Large Object in a database
//
// ****************************************************************
-class PgLargeObject : public PgConnection {
+class DLLIMPORT PgLargeObject : public PgConnection {
private:
int pgFd;
Oid pgObject;
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pgtransdb.h postgresql-7.1.2/src/interfaces/libpq++/pgtransdb.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pgtransdb.h Wed Jan 24 19:43:32 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pgtransdb.h Mon Jul 2 09:29:03 2001
@@ -34,7 +34,7 @@
// This is the database access class that keeps an open
// transaction block during its lifetime. The block is ENDed when
// the object is destroyed.
-class PgTransaction : public PgDatabase {
+class DLLIMPORT PgTransaction : public PgDatabase {
public:
PgTransaction(const char* conninfo); // use reasonable & environment defaults
// connect to the database with given environment and database name
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/win32.mak postgresql-7.1.2/src/interfaces/libpq++/win32.mak
--- postgresql-7.1.2.orig/src/interfaces/libpq++/win32.mak Thu Jan 1 00:00:00 1970
+++ postgresql-7.1.2/src/interfaces/libpq++/win32.mak Mon Jul 2 09:21:00 2001
@@ -0,0 +1,126 @@
+# Makefile for Microsoft Visual C++ 6.0 (or compat)
+
+# Will build a Win32 static library (non-debug) libpq++.lib
+# and a Win32 dynamic library (non-debug) libpq++.dll with import library libpq++dll.lib
+
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+.SUFFIXES : .cc
+
+CPP=cl.exe
+RSC=rc.exe
+
+OUTDIR=.\Release
+INTDIR=.\Release
+# Begin Custom Macros
+OutDir=.\Release
+# End Custom Macros
+
+ALL : "$(OUTDIR)\libpq++.dll" "$(OUTDIR)\libpq++.lib"
+
+CLEAN :
+ -@erase "$(INTDIR)\pgconnection.obj"
+ -@erase "$(INTDIR)\pgcursordb.obj"
+ -@erase "$(INTDIR)\pgdatabase.obj"
+ -@erase "$(INTDIR)\pglobject.obj"
+ -@erase "$(INTDIR)\pgtransdb.obj"
+ -@erase "$(OUTDIR)\libpq++.lib"
+ -@erase "$(OUTDIR)\libpq++.dll"
+ -@erase "$(OUTDIR)\libpq++dll.exp"
+ -@erase "$(OUTDIR)\libpq++dll.lib"
+ -@erase "$(OUTDIR)\libpq++dll.res"
+ -@erase "*.pch"
+ -@erase "$(OUTDIR)\libpq++.pch"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /TP /MD /W3 /GX /O2 /I "..\..\include" /I "..\libpq" /D "NDEBUG" /D\
+ "WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\libpq++.pch" /YX\
+ /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c /D "HAVE_VSNPRINTF" /D "HAVE_STRDUP"
+
+CPP_OBJS=.\Release/
+CPP_SBRS=.
+
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\libpq++.lib"
+LIB32_OBJS= \
+ "$(OUTDIR)\pgconnection.obj" \
+ "$(OUTDIR)\pgcursordb.obj" \
+ "$(OUTDIR)\pgdatabase.obj" \
+ "$(OUTDIR)\pglobject.obj" \
+ "$(OUTDIR)\pgtransdb.obj"
+
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\libpq++dll.res"
+
+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 wsock32.lib\
+ odbccp32.lib libpq.lib msvcrt.lib /nologo /subsystem:windows /dll /incremental:no\
+ /pdb:"$(OUTDIR)\libpq++.pdb" /machine:I386 /out:"$(OUTDIR)\libpq++.dll"\
+ /implib:"$(OUTDIR)\libpq++dll.lib" /libpath:"..\libpq\release"
+LINK32_OBJS= \
+ "$(OUTDIR)\pgconnection.obj" \
+ "$(OUTDIR)\pgcursordb.obj" \
+ "$(OUTDIR)\pgdatabase.obj" \
+ "$(OUTDIR)\pglobject.obj" \
+ "$(OUTDIR)\pgtransdb.obj" \
+ "$(OUTDIR)\libpq++dll.res"
+
+"$(INTDIR)\libpq++dll.res" : "$(INTDIR)" libpq++dll.rc
+ $(RSC) $(RSC_PROJ) libpq++dll.rc
+
+"$(OUTDIR)\libpq++.lib" : "$(OUTDIR)" $(LIB32_OBJS)
+ $(LIB32) @<<
+ $(LIB32_FLAGS) $(LIB32_OBJS)
+<<
+
+"$(OUTDIR)\libpq++.dll" : "$(OUTDIR)" $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+.c{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cc{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cc{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
diff -urN postgresql-7.1.2.orig/src/win32.mak postgresql-7.1.2/src/win32.mak
--- postgresql-7.1.2.orig/src/win32.mak Tue Jan 18 19:05:29 2000
+++ postgresql-7.1.2/src/win32.mak Mon Jul 2 09:21:00 2001
@@ -20,6 +20,8 @@
cd ..
cd interfaces\libpq
nmake /f win32.mak $(MAKEMACRO)
+ cd ..\libpq++
+ nmake /f win32.mak $(MAKEMACRO)
cd ..\..\bin\psql
nmake /f win32.mak $(MAKEMACRO)
cd ..\..
Attachments:
[text/plain] libpq++-2.diff (9.2K, ../../20010702165702.A1161@christian.chrullrich.de/2-libpq++-2.diff)
download | inline diff:
diff -urN postgresql-7.1.2.orig/src/include/c.h postgresql-7.1.2/src/include/c.h
--- postgresql-7.1.2.orig/src/include/c.h Thu Mar 22 04:00:24 2001
+++ postgresql-7.1.2/src/include/c.h Mon Jul 2 09:35:41 2001
@@ -606,8 +606,14 @@
#else /* not BUILDING_DLL */
#define DLLIMPORT __declspec (dllimport)
#endif
-#else /* not CYGWIN */
-#define DLLIMPORT
+#elif defined(WIN32) && defined(_MSC_VER) /* not CYGWIN */
+#if defined(_DLL)
+#define DLLIMPORT __declspec (dllexport)
+#else /* not _DLL */
+#define DLLIMPORT __declspec (dllimport)
+#endif
+#else /* not CYGWIN, not MSVC */
+#define DLLIMPORT
#endif
/* Provide prototypes for routines not present in a particular machine's
diff -urN postgresql-7.1.2.orig/src/include/config.h.win32 postgresql-7.1.2/src/include/config.h.win32
--- postgresql-7.1.2.orig/src/include/config.h.win32 Fri May 11 01:34:42 2001
+++ postgresql-7.1.2/src/include/config.h.win32 Mon Jul 2 09:28:12 2001
@@ -20,3 +20,6 @@
#define HAVE_ATEXIT
#define HAVE_MEMMOVE
+
+#define HAVE_CXX_STRING_HEADER
+#define HAVE_NAMESPACE_STD
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/libpq++dll.rc postgresql-7.1.2/src/interfaces/libpq++/libpq++dll.rc
--- postgresql-7.1.2.orig/src/interfaces/libpq++/libpq++dll.rc Thu Jan 1 00:00:00 1970
+++ postgresql-7.1.2/src/interfaces/libpq++/libpq++dll.rc Mon Jul 2 09:21:00 2001
@@ -0,0 +1,34 @@
+#include <winver.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 7,1,2,0
+ PRODUCTVERSION 7,1,2,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x40004L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "\0"
+ VALUE "CompanyName", " \0"
+ VALUE "FileDescription", "PostgreSQL C++ Access Library\0"
+ VALUE "FileVersion", "7, 1, 2, 0\0"
+ VALUE "InternalName", "libpq++\0"
+ VALUE "LegalCopyright", "Copyright © 2000\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "libpq++.dll\0"
+ VALUE "PrivateBuild", "\0"
+ VALUE "ProductName", "PostgreSQL\0"
+ VALUE "ProductVersion", "7, 1, 2, 0\0"
+ VALUE "SpecialBuild", "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pgconnection.h postgresql-7.1.2/src/interfaces/libpq++/pgconnection.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pgconnection.h Sat Feb 10 02:31:30 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pgconnection.h Mon Jul 2 09:28:35 2001
@@ -55,7 +55,7 @@
// This class contains all the information about the connection
// to the backend process. All the database classes should be
// derived from this class to obtain the connection interface.
-class PgConnection {
+class DLLIMPORT PgConnection {
protected:
PGconn* pgConn; // Connection Structure
PGresult* pgResult; // Current Query Result
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pgcursordb.h postgresql-7.1.2/src/interfaces/libpq++/pgcursordb.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pgcursordb.h Wed Jan 24 19:43:32 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pgcursordb.h Mon Jul 2 09:28:56 2001
@@ -36,7 +36,7 @@
// manipulates data through it. The interface will introduce some
// ease of use through the methods that will allow cursor specific
// operations, like fetch, forward, etc.
-class PgCursor : public PgTransaction {
+class DLLIMPORT PgCursor : public PgTransaction {
public:
PgCursor(const char* conninfo, const char* cursor); // use reasonable & environment defaults
// connect to the database with given environment and database name
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pgdatabase.h postgresql-7.1.2/src/interfaces/libpq++/pgdatabase.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pgdatabase.h Wed Jan 24 19:43:32 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pgdatabase.h Mon Jul 2 09:28:51 2001
@@ -34,7 +34,7 @@
// This is the basic database access class. Its interface should
// be used only after a query has been sent to the backend and
// results are being received.
-class PgDatabase : public PgConnection {
+class DLLIMPORT PgDatabase : public PgConnection {
public:
// connect to the database with conninfo
PgDatabase(const char* conninfo) : PgConnection(conninfo) {}
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pglobject.h postgresql-7.1.2/src/interfaces/libpq++/pglobject.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pglobject.h Wed Jan 24 19:43:32 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pglobject.h Mon Jul 2 09:28:44 2001
@@ -29,7 +29,7 @@
// PgLargeObject - a class for accessing Large Object in a database
//
// ****************************************************************
-class PgLargeObject : public PgConnection {
+class DLLIMPORT PgLargeObject : public PgConnection {
private:
int pgFd;
Oid pgObject;
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/pgtransdb.h postgresql-7.1.2/src/interfaces/libpq++/pgtransdb.h
--- postgresql-7.1.2.orig/src/interfaces/libpq++/pgtransdb.h Wed Jan 24 19:43:32 2001
+++ postgresql-7.1.2/src/interfaces/libpq++/pgtransdb.h Mon Jul 2 09:29:03 2001
@@ -34,7 +34,7 @@
// This is the database access class that keeps an open
// transaction block during its lifetime. The block is ENDed when
// the object is destroyed.
-class PgTransaction : public PgDatabase {
+class DLLIMPORT PgTransaction : public PgDatabase {
public:
PgTransaction(const char* conninfo); // use reasonable & environment defaults
// connect to the database with given environment and database name
diff -urN postgresql-7.1.2.orig/src/interfaces/libpq++/win32.mak postgresql-7.1.2/src/interfaces/libpq++/win32.mak
--- postgresql-7.1.2.orig/src/interfaces/libpq++/win32.mak Thu Jan 1 00:00:00 1970
+++ postgresql-7.1.2/src/interfaces/libpq++/win32.mak Mon Jul 2 09:21:00 2001
@@ -0,0 +1,126 @@
+# Makefile for Microsoft Visual C++ 6.0 (or compat)
+
+# Will build a Win32 static library (non-debug) libpq++.lib
+# and a Win32 dynamic library (non-debug) libpq++.dll with import library libpq++dll.lib
+
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+.SUFFIXES : .cc
+
+CPP=cl.exe
+RSC=rc.exe
+
+OUTDIR=.\Release
+INTDIR=.\Release
+# Begin Custom Macros
+OutDir=.\Release
+# End Custom Macros
+
+ALL : "$(OUTDIR)\libpq++.dll" "$(OUTDIR)\libpq++.lib"
+
+CLEAN :
+ -@erase "$(INTDIR)\pgconnection.obj"
+ -@erase "$(INTDIR)\pgcursordb.obj"
+ -@erase "$(INTDIR)\pgdatabase.obj"
+ -@erase "$(INTDIR)\pglobject.obj"
+ -@erase "$(INTDIR)\pgtransdb.obj"
+ -@erase "$(OUTDIR)\libpq++.lib"
+ -@erase "$(OUTDIR)\libpq++.dll"
+ -@erase "$(OUTDIR)\libpq++dll.exp"
+ -@erase "$(OUTDIR)\libpq++dll.lib"
+ -@erase "$(OUTDIR)\libpq++dll.res"
+ -@erase "*.pch"
+ -@erase "$(OUTDIR)\libpq++.pch"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /TP /MD /W3 /GX /O2 /I "..\..\include" /I "..\libpq" /D "NDEBUG" /D\
+ "WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\libpq++.pch" /YX\
+ /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c /D "HAVE_VSNPRINTF" /D "HAVE_STRDUP"
+
+CPP_OBJS=.\Release/
+CPP_SBRS=.
+
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\libpq++.lib"
+LIB32_OBJS= \
+ "$(OUTDIR)\pgconnection.obj" \
+ "$(OUTDIR)\pgcursordb.obj" \
+ "$(OUTDIR)\pgdatabase.obj" \
+ "$(OUTDIR)\pglobject.obj" \
+ "$(OUTDIR)\pgtransdb.obj"
+
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\libpq++dll.res"
+
+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 wsock32.lib\
+ odbccp32.lib libpq.lib msvcrt.lib /nologo /subsystem:windows /dll /incremental:no\
+ /pdb:"$(OUTDIR)\libpq++.pdb" /machine:I386 /out:"$(OUTDIR)\libpq++.dll"\
+ /implib:"$(OUTDIR)\libpq++dll.lib" /libpath:"..\libpq\release"
+LINK32_OBJS= \
+ "$(OUTDIR)\pgconnection.obj" \
+ "$(OUTDIR)\pgcursordb.obj" \
+ "$(OUTDIR)\pgdatabase.obj" \
+ "$(OUTDIR)\pglobject.obj" \
+ "$(OUTDIR)\pgtransdb.obj" \
+ "$(OUTDIR)\libpq++dll.res"
+
+"$(INTDIR)\libpq++dll.res" : "$(INTDIR)" libpq++dll.rc
+ $(RSC) $(RSC_PROJ) libpq++dll.rc
+
+"$(OUTDIR)\libpq++.lib" : "$(OUTDIR)" $(LIB32_OBJS)
+ $(LIB32) @<<
+ $(LIB32_FLAGS) $(LIB32_OBJS)
+<<
+
+"$(OUTDIR)\libpq++.dll" : "$(OUTDIR)" $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+.c{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cc{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cc{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
diff -urN postgresql-7.1.2.orig/src/win32.mak postgresql-7.1.2/src/win32.mak
--- postgresql-7.1.2.orig/src/win32.mak Tue Jan 18 19:05:29 2000
+++ postgresql-7.1.2/src/win32.mak Mon Jul 2 09:21:00 2001
@@ -20,6 +20,8 @@
cd ..
cd interfaces\libpq
nmake /f win32.mak $(MAKEMACRO)
+ cd ..\libpq++
+ nmake /f win32.mak $(MAKEMACRO)
cd ..\..\bin\psql
nmake /f win32.mak $(MAKEMACRO)
cd ..\..
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq++ on Windows
2001-06-30 17:37 libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 00:11 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
2001-07-01 07:48 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 15:45 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 18:28 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
2001-07-01 22:23 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-02 04:21 ` Re: libpq++ on Windows Tom Lane <tgl@sss.pgh.pa.us>
2001-07-02 14:57 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
@ 2001-07-11 22:12 ` Bruce Momjian <pgman@candle.pha.pa.us>
0 siblings, 0 replies; 26+ messages in thread
From: Bruce Momjian @ 2001-07-11 22:12 UTC (permalink / raw)
To: Christian Ullrich <chris@chrullrich.de>; +Cc: pgsql-interfaces
Thanks. Patch applied.
> * Tom Lane wrote on Monday, 2001-07-02:
>
> > config.h.in is absolutely NOT the right place for platform-specific
> > defines.
> >
> > I'd put this in the same category as DLLIMPORT, which is in c.h
> > (and just as ugly an example of Microsoft cultural imperialism,
> > but I suppose there's no point in arguing about it).
>
> Thanks for the help. You know, if I had looked into c.h in the first
> place, I might just have found that out myself.
> Here's another patch. It extends the DLLIMPORT declaration
> block and allows me to use that same macro in the class headers.
> I think it is correctly used there.
>
> --
> Christian Ullrich Registrierter Linux-User #125183
>
> "Sie k?nnen nach R'ed'mond fliegen -- aber Sie werden sterben"
[ Attachment, skipping... ]
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq++ on Windows
2001-06-30 17:37 libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 00:11 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
2001-07-01 07:48 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 15:45 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 18:28 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
2001-07-01 22:23 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
@ 2001-07-02 17:56 ` Peter Eisentraut <peter_e@gmx.net>
2001-07-03 04:22 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
1 sibling, 1 reply; 26+ messages in thread
From: Peter Eisentraut @ 2001-07-02 17:56 UTC (permalink / raw)
To: Christian Ullrich <chris@chrullrich.de>; +Cc: pgsql-interfaces
Christian Ullrich writes:
> Because the '#define DLLAPI' in config.h.in -- from which the
> config.h for Unix and Cygwin/Win32 builds is generated -- is
> necessary to make the compiler happy about the modifications
> to the class declarations.
Any given build will use exactly one of config.h.in or config.h.win32, so
you should decide which one you want to use. Since so far native Win32
builds have used config.h.win32 (by manually copying it to config.h, and
not running configure at all), this is what you should do.
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq++ on Windows
2001-06-30 17:37 libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 00:11 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
2001-07-01 07:48 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 15:45 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 18:28 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
2001-07-01 22:23 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-02 17:56 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
@ 2001-07-03 04:22 ` Christian Ullrich <chris@chrullrich.de>
0 siblings, 0 replies; 26+ messages in thread
From: Christian Ullrich @ 2001-07-03 04:22 UTC (permalink / raw)
To: pgsql-interfaces
* Peter Eisentraut wrote on Monday, 2001-07-02:
> Any given build will use exactly one of config.h.in or config.h.win32, so
> you should decide which one you want to use. Since so far native Win32
> builds have used config.h.win32 (by manually copying it to config.h, and
> not running configure at all), this is what you should do.
The new symbol "DLLAPI" I introduced is seen by any compiler,
Win32 or not. So I had to make that symbol known to any compiler,
Win32 or not (more precisely, to have the preprocessor remove it on
platforms other than Win32).
But because Tom Lane told me a better way of doing it, I have already
removed the changes to both config.h.in and (partly) config.h.win32.
--
Christian Ullrich Registrierter Linux-User #125183
"Sie können nach R'ed'mond fliegen -- aber Sie werden sterben"
^ permalink raw reply [nested|flat] 26+ messages in thread
* libpq on windows
@ 2005-05-19 13:52 Gustavo Lopes <contratempo@gmail.com>
2005-05-19 14:58 ` Re: libpq on windows John DeSoi <desoi@pgedit.com>
2005-05-20 06:32 ` Re: libpq on windows jtv@xs4all.nl
0 siblings, 2 replies; 26+ messages in thread
From: Gustavo Lopes @ 2005-05-19 13:52 UTC (permalink / raw)
To: pgsql-interfaces
Hi
I'm having trouble using libpq.dll (implicit linking with C programs).
I'm using libpq.dll v8.0.3.5131 (timestamp Wed May 11 11:12:58 2005)
and PostgreSQL 8.0.3 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC)
3.4.2 (mingw-special) v8.0.3.5131. I used both Borland C++ 5.5.1 and
Microsoft (R) 32-bit C/C++ Standard Compiler Version 12.00.8168.
The problem seems to occurr only when the server sends a hint or the
dll generates one. This can happen when the connection to the server
cannot be established because the server is not running, a nonexistant
postgres function exist is called, when one attempts to drop an index
upon which a constraint depends, etc. (the program doesn't go beyond
PQconnectdb, PQexec or PQexecparam). Since my debugging skills are
very poor I cannot give any accurate description on what is causing
the exception.
The problem can be very easily reproduced by creating a C program
which calls PQconnectdb with a host parameter that points to a machine
that is not running postgres.
Running the same program under linux (although I used older versions
of the interface and the server) does not cause any problems.
Gustavo Lopes
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq on windows
2005-05-19 13:52 libpq on windows Gustavo Lopes <contratempo@gmail.com>
@ 2005-05-19 14:58 ` John DeSoi <desoi@pgedit.com>
2005-05-19 23:52 ` Re: libpq on windows Gustavo Lopes <contratempo@gmail.com>
1 sibling, 1 reply; 26+ messages in thread
From: John DeSoi @ 2005-05-19 14:58 UTC (permalink / raw)
To: Gustavo Lopes <contratempo@gmail.com>; +Cc: pgsql-interfaces
On May 19, 2005, at 9:52 AM, Gustavo Lopes wrote:
> The problem can be very easily reproduced by creating a C program
> which calls PQconnectdb with a host parameter that points to a machine
> that is not running postgres.
> Running the same program under linux (although I used older versions
> of the interface and the server) does not cause any problems.
Try comparing what you are doing in this case to the psql source. It
uses libpq and I run tests regularly that try connecting to an invalid
server. I have not seen any problems.
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq on windows
2005-05-19 13:52 libpq on windows Gustavo Lopes <contratempo@gmail.com>
2005-05-19 14:58 ` Re: libpq on windows John DeSoi <desoi@pgedit.com>
@ 2005-05-19 23:52 ` Gustavo Lopes <contratempo@gmail.com>
0 siblings, 0 replies; 26+ messages in thread
From: Gustavo Lopes @ 2005-05-19 23:52 UTC (permalink / raw)
To: pgsql-interfaces
psql is too complex for me to analyze and I believe it's multithreaded
but anyway Ic ouldn't fathom anything substantially different when the
function PQsetdbLogin() is called (file startup.c).
It would probably be better to say what I've doing because it's
possible it's a mistake in some elementary aspect I haven't grasped.
Here is a sample program:
#include <libpq-fe.h>
#pragma comment(lib,"libpq.lib")
int main(void) {
PGconn *conn;
conn = PQconnectdb("host=localhost");
return 0;
}
The import library was created with "impdef -f -a libpq.lib libpq.dll"
(borland) and impdef/implib (vc++).
This program works only when postgresql is running.
Thanks in advance
Gustavo Lopes
On 19/05/05, John DeSoi <desoi@pgedit.com> wrote:
>
> On May 19, 2005, at 9:52 AM, Gustavo Lopes wrote:
>
> > The problem can be very easily reproduced by creating a C program
> > which calls PQconnectdb with a host parameter that points to a machine
> > that is not running postgres.
> > Running the same program under linux (although I used older versions
> > of the interface and the server) does not cause any problems.
>
> Try comparing what you are doing in this case to the psql source. It
> uses libpq and I run tests regularly that try connecting to an invalid
> server. I have not seen any problems.
>
>
> John DeSoi, Ph.D.
> http://pgedit.com/
> Power Tools for PostgreSQL
>
>
Attachments:
[application/octet-stream] libpq.rar (7.0K, ../../2b5c484b05051916527e953873@mail.gmail.com/2-libpq.rar)
download
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq on windows
2005-05-19 13:52 libpq on windows Gustavo Lopes <contratempo@gmail.com>
@ 2005-05-20 06:32 ` jtv@xs4all.nl
2005-05-20 13:20 ` Re: libpq on windows Gustavo Lopes <contratempo@gmail.com>
1 sibling, 1 reply; 26+ messages in thread
From: jtv@xs4all.nl @ 2005-05-20 06:32 UTC (permalink / raw)
To: Gustavo Lopes <contratempo@gmail.com>; +Cc: pgsql-interfaces
Gustavo Lopes <contratempo@gmail.com> wrote:
> The problem seems to occurr only when the server sends a hint or the
> dll generates one. This can happen when the connection to the server
> cannot be established because the server is not running, a nonexistant
> postgres function exist is called, when one attempts to drop an index
> upon which a constraint depends, etc. (the program doesn't go beyond
> PQconnectdb, PQexec or PQexecparam). Since my debugging skills are
> very poor I cannot give any accurate description on what is causing
> the exception.
> The problem can be very easily reproduced by creating a C program
> which calls PQconnectdb with a host parameter that points to a machine
> that is not running postgres.
> Running the same program under linux (although I used older versions
> of the interface and the server) does not cause any problems.
It could be the notice processor that crashes. A "notice processor" is a
callback that you can register with libpq that handles error messages.
The default is to print them to the console, but I'm not sure you can
always do that in a Windows program. Or since you're apparently using
different compilers for libpq and the application, maybe the default
notice processor gets linked to a different standard library than it
expects and fails because of that.
Notice processors are documented here:
http://www.postgresql.org/docs/8.0/interactive/libpq-notice-processing.html
To find out if this is what's wrong, try creating an empty function (with
C-style calling convention, not a regular C++ function) and setting that
as the notice processor:
extern "C" { /* (this line only needed in C++) */
void emptynoticeprocessor(void *, const char *)
{
}
} /* (this line only needed in C++) */
Now in your code, just after you opened your connection (call it "c"):
PQsetNoticeProcessor(c,emptynoticeprocessor,NULL);
Of course that will mean that error messages are not displayed, so if this
solves your crashing problem then your next step is to implement something
here that displays the given message!
Jeroen
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq on windows
2005-05-19 13:52 libpq on windows Gustavo Lopes <contratempo@gmail.com>
2005-05-20 06:32 ` Re: libpq on windows jtv@xs4all.nl
@ 2005-05-20 13:20 ` Gustavo Lopes <contratempo@gmail.com>
2005-05-20 16:54 ` Re: libpq on windows Gustavo Lopes <contratempo@gmail.com>
0 siblings, 1 reply; 26+ messages in thread
From: Gustavo Lopes @ 2005-05-20 13:20 UTC (permalink / raw)
To: pgsql-interfaces
No, I'd say the notice processor/receiver is not the problem since
I've been able to implement a notice receiver that would display the
received notices without any complications.
The problem seems to arise only when a message contains a HINT
attached (I don't even know whether messages of type NOTICE can
cointain a hint field, but anyway that doesn't seem relevant to this
issue).
Gustavio Lopes
On 20/05/05, jtv@xs4all.nl <jtv@xs4all.nl> wrote:
> Gustavo Lopes <contratempo@gmail.com> wrote:
>
> > The problem seems to occurr only when the server sends a hint or the
> > dll generates one. This can happen when the connection to the server
> > cannot be established because the server is not running, a nonexistant
> > postgres function exist is called, when one attempts to drop an index
> > upon which a constraint depends, etc. (the program doesn't go beyond
> > PQconnectdb, PQexec or PQexecparam). Since my debugging skills are
> > very poor I cannot give any accurate description on what is causing
> > the exception.
> > The problem can be very easily reproduced by creating a C program
> > which calls PQconnectdb with a host parameter that points to a machine
> > that is not running postgres.
> > Running the same program under linux (although I used older versions
> > of the interface and the server) does not cause any problems.
>
> It could be the notice processor that crashes. A "notice processor" is a
> callback that you can register with libpq that handles error messages.
> The default is to print them to the console, but I'm not sure you can
> always do that in a Windows program. Or since you're apparently using
> different compilers for libpq and the application, maybe the default
> notice processor gets linked to a different standard library than it
> expects and fails because of that.
>
> Notice processors are documented here:
>
> http://www.postgresql.org/docs/8.0/interactive/libpq-notice-processing.html
>
> To find out if this is what's wrong, try creating an empty function (with
> C-style calling convention, not a regular C++ function) and setting that
> as the notice processor:
>
> extern "C" { /* (this line only needed in C++) */
> void emptynoticeprocessor(void *, const char *)
> {
> }
> } /* (this line only needed in C++) */
>
> Now in your code, just after you opened your connection (call it "c"):
>
> PQsetNoticeProcessor(c,emptynoticeprocessor,NULL);
>
> Of course that will mean that error messages are not displayed, so if this
> solves your crashing problem then your next step is to implement something
> here that displays the given message!
>
> Jeroen
>
>
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq on windows
2005-05-19 13:52 libpq on windows Gustavo Lopes <contratempo@gmail.com>
2005-05-20 06:32 ` Re: libpq on windows jtv@xs4all.nl
2005-05-20 13:20 ` Re: libpq on windows Gustavo Lopes <contratempo@gmail.com>
@ 2005-05-20 16:54 ` Gustavo Lopes <contratempo@gmail.com>
2005-05-20 18:51 ` Re: libpq on windows Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 26+ messages in thread
From: Gustavo Lopes @ 2005-05-20 16:54 UTC (permalink / raw)
To: pgsql-interfaces
Actually it seems the hints are not the problem. I see no pattern now.
For instance, if table "j" doesn't exist, "drop table j" is ok but not
"drop table".
Gustavo Lopes
On 20/05/05, Gustavo Lopes <contratempo@gmail.com> wrote:
> No, I'd say the notice processor/receiver is not the problem since
> I've been able to implement a notice receiver that would display the
> received notices without any complications.
> The problem seems to arise only when a message contains a HINT
> attached (I don't even know whether messages of type NOTICE can
> cointain a hint field, but anyway that doesn't seem relevant to this
> issue).
>
> Gustavio Lopes
>
> On 20/05/05, jtv@xs4all.nl <jtv@xs4all.nl> wrote:
> > Gustavo Lopes <contratempo@gmail.com> wrote:
> >
> > > The problem seems to occurr only when the server sends a hint or the
> > > dll generates one. This can happen when the connection to the server
> > > cannot be established because the server is not running, a nonexistant
> > > postgres function exist is called, when one attempts to drop an index
> > > upon which a constraint depends, etc. (the program doesn't go beyond
> > > PQconnectdb, PQexec or PQexecparam). Since my debugging skills are
> > > very poor I cannot give any accurate description on what is causing
> > > the exception.
> > > The problem can be very easily reproduced by creating a C program
> > > which calls PQconnectdb with a host parameter that points to a machine
> > > that is not running postgres.
> > > Running the same program under linux (although I used older versions
> > > of the interface and the server) does not cause any problems.
> >
> > It could be the notice processor that crashes. A "notice processor" is a
> > callback that you can register with libpq that handles error messages.
> > The default is to print them to the console, but I'm not sure you can
> > always do that in a Windows program. Or since you're apparently using
> > different compilers for libpq and the application, maybe the default
> > notice processor gets linked to a different standard library than it
> > expects and fails because of that.
> >
> > Notice processors are documented here:
> >
> > http://www.postgresql.org/docs/8.0/interactive/libpq-notice-processing.html
> >
> > To find out if this is what's wrong, try creating an empty function (with
> > C-style calling convention, not a regular C++ function) and setting that
> > as the notice processor:
> >
> > extern "C" { /* (this line only needed in C++) */
> > void emptynoticeprocessor(void *, const char *)
> > {
> > }
> > } /* (this line only needed in C++) */
> >
> > Now in your code, just after you opened your connection (call it "c"):
> >
> > PQsetNoticeProcessor(c,emptynoticeprocessor,NULL);
> >
> > Of course that will mean that error messages are not displayed, so if this
> > solves your crashing problem then your next step is to implement something
> > here that displays the given message!
> >
> > Jeroen
> >
> >
>
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq on windows
2005-05-19 13:52 libpq on windows Gustavo Lopes <contratempo@gmail.com>
2005-05-20 06:32 ` Re: libpq on windows jtv@xs4all.nl
2005-05-20 13:20 ` Re: libpq on windows Gustavo Lopes <contratempo@gmail.com>
2005-05-20 16:54 ` Re: libpq on windows Gustavo Lopes <contratempo@gmail.com>
@ 2005-05-20 18:51 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-05-20 23:43 ` Re: libpq on windows Gustavo Lopes <contratempo@gmail.com>
0 siblings, 1 reply; 26+ messages in thread
From: Tom Lane @ 2005-05-20 18:51 UTC (permalink / raw)
To: Gustavo Lopes <contratempo@gmail.com>; +Cc: pgsql-interfaces
Gustavo Lopes <contratempo@gmail.com> writes:
> Actually it seems the hints are not the problem. I see no pattern now.
> For instance, if table "j" doesn't exist, "drop table j" is ok but not
> "drop table".
Well, the latter generates a syntax complaint:
regression=# drop table j;
ERROR: table "j" does not exist
regression=# drop table ;
ERROR: syntax error at or near ";" at character 12
LINE 1: drop table ;
^
regression=#
Maybe the pattern is "any multi-line error message causes a problem"?
regards, tom lane
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq on windows
2005-05-19 13:52 libpq on windows Gustavo Lopes <contratempo@gmail.com>
2005-05-20 06:32 ` Re: libpq on windows jtv@xs4all.nl
2005-05-20 13:20 ` Re: libpq on windows Gustavo Lopes <contratempo@gmail.com>
2005-05-20 16:54 ` Re: libpq on windows Gustavo Lopes <contratempo@gmail.com>
2005-05-20 18:51 ` Re: libpq on windows Tom Lane <tgl@sss.pgh.pa.us>
@ 2005-05-20 23:43 ` Gustavo Lopes <contratempo@gmail.com>
2005-05-22 07:22 ` Re: libpq on windows Volkan YAZICI <volkan.yazici@gmail.com>
0 siblings, 1 reply; 26+ messages in thread
From: Gustavo Lopes @ 2005-05-20 23:43 UTC (permalink / raw)
To: pgsql-interfaces
Is there any easy (ie, no C postgres functions) way to generate
multi-line error messages so that I can explore that possibility?
Gustavo Lopes
On 20/05/05, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Gustavo Lopes <contratempo@gmail.com> writes:
> > Actually it seems the hints are not the problem. I see no pattern now.
> > For instance, if table "j" doesn't exist, "drop table j" is ok but not
> > "drop table".
>
> Well, the latter generates a syntax complaint:
>
> regression=# drop table j;
> ERROR: table "j" does not exist
> regression=# drop table ;
> ERROR: syntax error at or near ";" at character 12
> LINE 1: drop table ;
> ^
> regression=#
>
> Maybe the pattern is "any multi-line error message causes a problem"?
>
> regards, tom lane
>
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq on windows
2005-05-19 13:52 libpq on windows Gustavo Lopes <contratempo@gmail.com>
2005-05-20 06:32 ` Re: libpq on windows jtv@xs4all.nl
2005-05-20 13:20 ` Re: libpq on windows Gustavo Lopes <contratempo@gmail.com>
2005-05-20 16:54 ` Re: libpq on windows Gustavo Lopes <contratempo@gmail.com>
2005-05-20 18:51 ` Re: libpq on windows Tom Lane <tgl@sss.pgh.pa.us>
2005-05-20 23:43 ` Re: libpq on windows Gustavo Lopes <contratempo@gmail.com>
@ 2005-05-22 07:22 ` Volkan YAZICI <volkan.yazici@gmail.com>
0 siblings, 0 replies; 26+ messages in thread
From: Volkan YAZICI @ 2005-05-22 07:22 UTC (permalink / raw)
To: Gustavo Lopes <contratempo@gmail.com>; +Cc: pgsql-interfaces
Hi,
On 5/21/05, Gustavo Lopes <contratempo@gmail.com> wrote:
> Is there any easy (ie, no C postgres functions) way to generate
> multi-line error messages so that I can explore that possibility?
One way of generating mult-line error messages could be increasing
verbosity level:
=> \set verbosity verbose
=> CREATE TABLE del_me_1 (id1 integer PRIMARY KEY);
=> CREATE TABLE del_me_2 (id2 integer REFERENCES del_me_1 (id1) );
=> DROP TABLE del_me_1;
NOTICE: constraint del_me_2_id2_fkey on table del_me_2 depends on
table del_me_1
ERROR: cannot drop table del_me_1 because other objects depend on it
HINT: Use DROP ... CASCADE to drop the dependent objects too.
HTH.
Regards.
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq on windows
@ 2005-05-22 13:18 Magnus Hagander <mha@sollentuna.net>
2005-05-22 17:48 ` Re: libpq on windows Gustavo Lopes <contratempo@gmail.com>
0 siblings, 1 reply; 26+ messages in thread
From: Magnus Hagander @ 2005-05-22 13:18 UTC (permalink / raw)
To: Gustavo Lopes <contratempo@gmail.com>; pgsql-interfaces
I've done a couple of tests and in all my tests I see no problems with
multiline error messages.
Also, if I read your original post right, yuou're seeing the problem in
a program that does a simple "PQconnectdb()" to a server that's not
running, in which case the normal errormsg-from-backend routines are
definitly not involved. it looks more like "random errors" to me.
Do you see this problem if you use the psql.exe command to connect to
the very same machine? Since psql.exe uses libpq, if it works there,
then it's not "deep inside libpq" at least.
It looks like you are using Borland C++ to compile your program, right?
Could you try the same program compiled with the MingW compiler? It
could be that your import library is somehow incorrect (say bad function
calling conventions, bad function ordering or something), which would
lead to strange errors.
Your simple test program from
http://archives.postgresql.org/pgsql-interfaces/2005-05/msg00044.php
works just fine in my installation - it doesn't do anything, but it
doesn't crash either. Compiled with MingW that is, I don't have Borland
to test with. And with manual linking and not the #pragma link, because
that appears to be a Borlandism.
//Magnus
>Is there any easy (ie, no C postgres functions) way to generate
>multi-line error messages so that I can explore that possibility?
>
>Gustavo Lopes
>
>On 20/05/05, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Gustavo Lopes <contratempo@gmail.com> writes:
>> > Actually it seems the hints are not the problem. I see no
>pattern now.
>> > For instance, if table "j" doesn't exist, "drop table j"
>is ok but not
>> > "drop table".
>>
>> Well, the latter generates a syntax complaint:
>>
>> regression=# drop table j;
>> ERROR: table "j" does not exist
>> regression=# drop table ;
>> ERROR: syntax error at or near ";" at character 12
>> LINE 1: drop table ;
>> ^
>> regression=#
>>
>> Maybe the pattern is "any multi-line error message causes a problem"?
>>
>> regards, tom lane
>>
>
>---------------------------(end of
>broadcast)---------------------------
>TIP 9: the planner will ignore your desire to choose an index
>scan if your
> joining column's datatypes do not match
>
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq on windows
2005-05-22 13:18 Re: libpq on windows Magnus Hagander <mha@sollentuna.net>
@ 2005-05-22 17:48 ` Gustavo Lopes <contratempo@gmail.com>
0 siblings, 0 replies; 26+ messages in thread
From: Gustavo Lopes @ 2005-05-22 17:48 UTC (permalink / raw)
To: pgsql-interfaces
There were no problems with the executables when I compiled them with MingW.
I've also been able to compile working executables with VC++ by using
the /MD option - link with msvcrt runtime library, which MingW and
libpq.dll also use (I found this by accident).
While this really mitigates my problem (I am able to build working
executables), this behaviour is still a mystery to me so any comments
would be appreciated.
Gustavo Lopes
On 22/05/05, Magnus Hagander <mha@sollentuna.net> wrote:
> I've done a couple of tests and in all my tests I see no problems with
> multiline error messages.
>
> Also, if I read your original post right, yuou're seeing the problem in
> a program that does a simple "PQconnectdb()" to a server that's not
> running, in which case the normal errormsg-from-backend routines are
> definitly not involved. it looks more like "random errors" to me.
>
> Do you see this problem if you use the psql.exe command to connect to
> the very same machine? Since psql.exe uses libpq, if it works there,
> then it's not "deep inside libpq" at least.
>
> It looks like you are using Borland C++ to compile your program, right?
> Could you try the same program compiled with the MingW compiler? It
> could be that your import library is somehow incorrect (say bad function
> calling conventions, bad function ordering or something), which would
> lead to strange errors.
>
> Your simple test program from
> http://archives.postgresql.org/pgsql-interfaces/2005-05/msg00044.php
> works just fine in my installation - it doesn't do anything, but it
> doesn't crash either. Compiled with MingW that is, I don't have Borland
> to test with. And with manual linking and not the #pragma link, because
> that appears to be a Borlandism.
>
> //Magnus
>
>
> >Is there any easy (ie, no C postgres functions) way to generate
> >multi-line error messages so that I can explore that possibility?
> >
> >Gustavo Lopes
> >
> >On 20/05/05, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >> Gustavo Lopes <contratempo@gmail.com> writes:
> >> > Actually it seems the hints are not the problem. I see no
> >pattern now.
> >> > For instance, if table "j" doesn't exist, "drop table j"
> >is ok but not
> >> > "drop table".
> >>
> >> Well, the latter generates a syntax complaint:
> >>
> >> regression=# drop table j;
> >> ERROR: table "j" does not exist
> >> regression=# drop table ;
> >> ERROR: syntax error at or near ";" at character 12
> >> LINE 1: drop table ;
> >> ^
> >> regression=#
> >>
> >> Maybe the pattern is "any multi-line error message causes a problem"?
> >>
> >> regards, tom lane
> >>
> >
> >---------------------------(end of
> >broadcast)---------------------------
> >TIP 9: the planner will ignore your desire to choose an index
> >scan if your
> > joining column's datatypes do not match
> >
>
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: libpq on windows
@ 2012-12-06 04:19 rajashekar <rajashekarpanneti@yahoo.in>
0 siblings, 0 replies; 26+ messages in thread
From: rajashekar @ 2012-12-06 04:19 UTC (permalink / raw)
To: pgsql-interfaces
psql is too complex for me to analyze and I believe it's multithreaded
but anyway Ic ouldn't fathom anything substantially different when the
function PQsetdbLogin() is called (file startup.c).
It would probably be better to say what I've doing because it's
possible it's a mistake in some elementary aspect I haven't grasped.
Here is a sample program:
#include <libpq-fe.h>
#pragma comment(lib,"libpq.lib")
int main(void) {
PGconn *conn;
conn = PQconnectdb("host=localhost");
return 0;
}
The import library was created with "impdef -f -a libpq.lib libpq.dll"
(borland) and impdef/implib (vc++).
This program works only when postgresql is running.
Thanks in advance
Gustavo Lopes
-----
--
View this message in context: http://postgresql.1045698.n5.nabble.com/Re-INTERFACES-libpq-on-windows-tp5735413.html
Sent from the PostgreSQL - interfaces mailing list archive at Nabble.com.
^ permalink raw reply [nested|flat] 26+ messages in thread
end of thread, other threads:[~2012-12-06 04:19 UTC | newest]
Thread overview: 26+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-06-28 08:56 libpq on windows "Jean-Sébastien ANDUJAR" <jandujar@transiciel.com>
2001-06-28 09:21 libpq on windows "Jean-Sébastien ANDUJAR" <jandujar@transiciel.com>
2001-06-30 17:37 libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-06-30 19:35 ` Re: libpq++ on Windows jtv <jtv@xs4all.nl>
2001-07-01 00:11 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
2001-07-01 07:48 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 15:45 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-01 18:28 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
2001-07-01 22:23 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-02 04:21 ` Re: libpq++ on Windows Tom Lane <tgl@sss.pgh.pa.us>
2001-07-02 14:57 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2001-07-11 22:12 ` Re: libpq++ on Windows Bruce Momjian <pgman@candle.pha.pa.us>
2001-07-02 17:56 ` Re: libpq++ on Windows Peter Eisentraut <peter_e@gmx.net>
2001-07-03 04:22 ` Re: libpq++ on Windows Christian Ullrich <chris@chrullrich.de>
2005-05-19 13:52 libpq on windows Gustavo Lopes <contratempo@gmail.com>
2005-05-19 14:58 ` John DeSoi <desoi@pgedit.com>
2005-05-19 23:52 ` Gustavo Lopes <contratempo@gmail.com>
2005-05-20 06:32 ` jtv@xs4all.nl
2005-05-20 13:20 ` Gustavo Lopes <contratempo@gmail.com>
2005-05-20 16:54 ` Gustavo Lopes <contratempo@gmail.com>
2005-05-20 18:51 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-05-20 23:43 ` Gustavo Lopes <contratempo@gmail.com>
2005-05-22 07:22 ` Volkan YAZICI <volkan.yazici@gmail.com>
2005-05-22 13:18 Re: libpq on windows Magnus Hagander <mha@sollentuna.net>
2005-05-22 17:48 ` Gustavo Lopes <contratempo@gmail.com>
2012-12-06 04:19 Re: libpq on windows rajashekar <rajashekarpanneti@yahoo.in>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox