pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julien Rouhaud <rjuju123@gmail.com>
To: mario@emmenlauer.de
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17365: Error: redefinition of 'stat' in win32_port.h when including postgres.h
Date: Thu, 13 Jan 2022 20:23:10 +0800
Message-ID: <20220113122310.ay24ciikcu257nkp@jrouhaud> (raw)
In-Reply-To: <17365-c58cbf9d0c29586a@postgresql.org>
References: <17365-c58cbf9d0c29586a@postgresql.org>

Hi,

On Thu, Jan 13, 2022 at 09:11:45AM +0000, PG Bug reporting form wrote:
> The following bug has been logged on the website:
> 
> Then I build a wrapper library that uses `postgres.h` in my code. My code is
> built using the LLVM Clang-Cl compiler frontend version 13.0.0 over
> Microsoft Visual Studio 19.5. Generally, the Clang-Cl compiler frontend
> works very well. But since updating PostgreSQL from 13.x to the 14.1
> release, I get an error:
> ```
[...]
> C:\BDA\bld\XTJyb_7r\0\DatabaseHandler\src\BDAPGResult.cc
> In file included from
> C:\BDA\bld\XTJyb_7r\0\DatabaseHandler\src\BDAPGResult.cc:31:
> In file included from C:\data\ci-dst\Debug\include\server\postgres.h:46:
> In file included from C:\data\ci-dst\Debug\include\server/c.h:1362:
> In file included from C:\data\ci-dst\Debug\include\server/port.h:26:
> C:\data\ci-dst\Debug\include\server/port/win32_port.h(256,8): error:
> redefinition of 'stat'
> struct stat                                             /* This should match
> struct __stat64 */
>        ^
> C:\Program Files (x86)\Windows
> Kits\10\include\10.0.19041.0\ucrt\sys/stat.h(87,12): note: previous
> definition is here
>     struct stat
>            ^
> 1 error generated.
> ```

Note that postgres.h is intended for backend-side code, and I'm assuming that
your wrapper library is client code?  Have you tried using postgres_fe.h
instead?





view thread (7+ messages)  latest in thread

Message-ID: <20220113122310.ay24ciikcu257nkp@jrouhaud>
Permalink:  ../20220113122310.ay24ciikcu257nkp@jrouhaud/
Also on:    postgresql.org/message-id/20220113122310.ay24ciikcu257nkp@jrouhaud

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: rjuju123@gmail.com, mario@emmenlauer.de
  Subject: Re: BUG #17365: Error: redefinition of 'stat' in win32_port.h when including postgres.h
  In-Reply-To: <20220113122310.ay24ciikcu257nkp@jrouhaud>
  References: <17365-c58cbf9d0c29586a@postgresql.org> <20220113122310.ay24ciikcu257nkp@jrouhaud>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox