c - 错误 C2011 : 'timezone' :'struct' type redefinition (postgres)

标签 c visual-studio postgresql visual-studio-2012

我正在尝试构建一个。 dll 文件以使用 C 函数扩展 postgres 服务器。 我正在使用 visual studio 2012 构建 dll 和 PostgreSQL 9.2。我导入了所有目录 postgres "\include\server*" 但是我有错误:

error C2011: 'timezone': 'struct' type redefinition

error C2011: 'itimerval': 'struct' type redefinition

在文件 *pg_confi_os.h* 的第 205 和 214 行

我试过这个 solution但没有成功。

如何解决这个问题?

最佳答案

我今天看了一下,发现这是 PostgreSQL 包含文件中的一个错误。参见 this mailing list post .

您可以通过在项目文件的预处理器指令中显式定义 WIN32 来解决这个问题。

参见 my blog post on the topic today

关于c - 错误 C2011 : 'timezone' :'struct' type redefinition (postgres),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14538652/

相关文章:

java - Tizen Mobile 和 iPad Linux - 它是否允许 GCC 和 Java?

c - 这段 C 代码有什么问题?

visual-studio - Apple Mac 上带有 PC 键盘的 Windows Phone 模拟器

postgresql - Postgres 初学者层的问题

大表上的 PostgreSQL 连接重置

c - ARMCC 5 对 strtol 和 strtod 的优化

c - Swiss Ephemeris 程序 swetest - Windows 和 Ubuntu 中的不同输出

c++ - 有选择地禁用第三方库的 C++ Core Guidelines Checker

sql-server - 不带 SQL Server 的 Visual Studio 2015

r - dplyr 自动断开 postgres 连接问题