Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g2CFe-0008Oj-2j for pgsql-general@arkaria.postgresql.org; Tue, 18 Sep 2018 09:24:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g2CFc-000601-Ne for pgsql-general@arkaria.postgresql.org; Tue, 18 Sep 2018 09:24:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g2CFc-0005zu-FS for pgsql-general@lists.postgresql.org; Tue, 18 Sep 2018 09:24:56 +0000 Received: from weald.air.saab.se ([136.163.212.3]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g2CFT-0002TD-Jn for pgsql-general@lists.postgresql.org; Tue, 18 Sep 2018 09:24:54 +0000 Received: from mailhub2.air.saab.se ([136.163.213.5]) by weald.air.saab.se (8.14.4/8.14.4) with ESMTP id w8I9OlTA018202 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 18 Sep 2018 11:24:47 +0200 Received: from corpappl847.corp.saab.se (corpappl847.corp.saab.se [136.163.113.247]) by mailhub2.air.saab.se (8.13.8/8.13.8) with ESMTP id w8I9Oa2H018813 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL) for ; Tue, 18 Sep 2018 11:24:36 +0200 Received: from CORPAPPL840.corp.saab.se (136.163.113.240) by corpappl847.corp.saab.se (136.163.113.247) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 18 Sep 2018 11:24:36 +0200 Received: from CORPAPPL840.corp.saab.se ([136.163.113.240]) by CORPAPPL840.corp.saab.se ([136.163.113.240]) with mapi id 15.00.1367.000; Tue, 18 Sep 2018 11:24:36 +0200 From: =?iso-8859-1?Q?Nordstr=F6m_Thomas?= To: "pgsql-general@lists.postgresql.org" Subject: Issues with compiling libpq 9.1.2 with Visual C++ Thread-Topic: Issues with compiling libpq 9.1.2 with Visual C++ Thread-Index: AdRPMTwnw2EDVNNNTsqFblDjzwgJhw== Date: Tue, 18 Sep 2018 09:24:36 +0000 Message-ID: Accept-Language: sv-SE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [136.163.112.148] Content-Type: multipart/alternative; boundary="_000_e50405d5e33c48ac85929d78b0ac2fd0CORPAPPL840corpsaabse_" MIME-Version: 1.0 X-Saab-MailScanner-Information: Please contact the ISP for more information X-Saab-MailScanner-ID: w8I9Oa2H018813 X-Saab-MailScanner: Found to be clean X-Saab-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (not cached, score=0.078, required 5, autolearn=not spam, HTML_MESSAGE 0.00, TW_BP 0.08) X-Saab-MailScanner-From: thomas.nordstrom1@saabgroup.com X-Saab-MailScanner-Watermark: 1537867476.98376@Bl+Kts7OALfsROz8ZAK6eA X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (weald.air.saab.se [136.163.212.3]); Tue, 18 Sep 2018 11:24:47 +0200 (CEST) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_000_e50405d5e33c48ac85929d78b0ac2fd0CORPAPPL840corpsaabse_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable OS: Windows 10 Toolset: vc141 (Visual Studio 2017) I'm having trouble compiling version 9.1.2 of libpq with Visual C++. The re= ason that I want this particular version is because it's the one included w= ith GDAL version 2.1.3 from GISinternals.com. To be specific, I pulled comm= it cfd8cf37d20be715e4bb9e382844c79556516824 from GitHub. What I'm doing is running a powershell script with the following command (o= f course, I've already run the batch-file included with Visual Studio which= sets all the relevant PATH environment variables needed to compile with Vi= sual C++): nmake /f "win32.mak" DEBUG=3D1 USE_SSL=3D1 SSL_INC=3D"$opensslDir\include" = SSL_LIB_PATH=3D"$opensslDir\x86\Debug\lib\" This first complains that there's no libpq-dist.rc. Through some googling I= found this page: https://pgolub.wordpress.com/2009/04/13/building-postgres= ql-client-library-using-borland-c-compiler-bcc-under-winxp/ It says to just= rename libpq.rc.in. This at least stops the error message, but it then com= plains about not finding libpqdll.def. That page said that the author solve= d it by simply finding an old version of that file, which to me sounds like= a bad idea and also I've been unable to do. If I run the build again it doesn't complain about the lack of libpqdll.def= and claims that all Win32 files have been built. The static lib *seems* to= have been built correctly, but the libpq.dll is 0 kB and there's no libpqd= ll.lib, so it clearly fails. I'm *guessing* that both libpq-dist.rc and libpqdll.def would have been gen= erated by running .\configure. However, when I try doing that it only looks= for gcc and cc, but not cl.exe, so it gives the error that there's "no acc= eptable C compiler found in $PATH". I've found through Googling around that= a lot of other people have .\configure scripts that look for cl.exe as wel= l. I'm running .\configure like this, btw: sh .\configure "sh" is Git Bash. So, How do I get libpq-dist.rc and libpqdll.def? (Through .\configure?) If I have to use .\configure, how do I get it to look for cl.exe? Thank you. --_000_e50405d5e33c48ac85929d78b0ac2fd0CORPAPPL840corpsaabse_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

OS: Windows 10

Toolset: vc141 (Visual Studio 2017)

 

I’m having trouble compiling version 9.1.2 of = libpq with Visual C++. The reason that I want this particular versi= on is because it’s the one included with GDAL version 2.1.3 from GISi= nternals.com. To be specific, I pulled commit cfd8cf37d20be715e4bb9e382844c= 79556516824 from GitHub.

 

What I’m doing is running a powershell script = with the following command (of course, I’ve already run the batch-fil= e included with Visual Studio which sets all the relevant PATH environment = variables needed to compile with Visual C++):

 

nmake /f “win32.m= ak” DEBUG=3D1 USE_SSL=3D1 SSL_INC=3D”$opensslDir\include”= SSL_LIB_PATH=3D”$opensslDir\x86\Debug\lib\”

 

This first complains that there’s no libpq-dis= t.rc. Through some googling I found this page: https://pgolub.wordpress.com/2009/04/13/building-postgresql-client-library-= using-borland-c-compiler-bcc-under-winxp/ It says to just rename libpq.= rc.in. This at least stops the error message, but it then complains about n= ot finding libpqdll.def. That page said that the author solved it by simply finding an old version of that fi= le, which to me sounds like a bad idea and also I’ve been unable to d= o.

 

If I run the build again it doesn’t complain a= bout the lack of libpqdll.def and claims that all Win32 files have been bui= lt. The static lib *seems* to have been built correctly, but the lib= pq.dll is 0 kB and there’s no libpqdll.lib, so it clearly fails.

 

I’m *guessing* that both libpq-dist.rc = and libpqdll.def would have been generated by running .\configure. However,= when I try doing that it only looks for gcc and cc, but not cl.exe, so it = gives the error that there’s “no acceptable C compiler found in $PATH”. I’ve found through Googling around= that a lot of other people have .\configure scripts that look for cl.exe a= s well.

I’m running .\configure like this, btw:

 

sh .\configure

 

“sh” is Git Bash.

 

So,

How do I get libpq-dist.rc and libpqdll.def? (Throug= h .\configure?)

If I have to use .\configure, how do I get it to loo= k for cl.exe?

 

Thank you.

--_000_e50405d5e33c48ac85929d78b0ac2fd0CORPAPPL840corpsaabse_--