我正在尝试构建一个。 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 来解决这个问题。
关于c - 错误 C2011 : 'timezone' :'struct' type redefinition (postgres),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14538652/