错误C2011:'时区':'结构'重新定义类型(Postgres的) [英] error C2011: 'timezone':'struct' type redefinition (postgres)
问题描述
我想建立一个。 dll文件与C函数扩展Postgres的服务器。
我使用的Visual Studio 2012来构建的dll和PostgreSQL 9.2。我进口的所有目录Postgres的\\包括\\服务器*
但我有错误:
错误C2011:'时区':'结构'类型重新定义
错误C2011:'itimerval':'结构'类型重新定义
块引用>在文件* pg_confi_os.h * 205行和214
我试过这个解决方案但没有成功。
如何解决这个问题呢?
解决方案我接过来一看这个今天,发现它在PostgreSQL的一个bug包含文件。请参见这个邮件列表帖子。
您可以通过在项目文件中的preprocessor指令明确定义WIN32解决它。
请参阅今天 <话题我的博客文章/ p>
I'm trying to build a. dll file to extend the postgres server with C functions. I'm using visual studio 2012 to build the dll, and PostgreSQL 9.2. I imported all directories postgres "\include\server*" But I'm having the errors:
error C2011: 'timezone': 'struct' type redefinition
error C2011: 'itimerval': 'struct' type redefinition
In the file *pg_confi_os.h* at line 205 and 214
I tried this solution but had no success.
How to solve this problem?
解决方案I took a look at this today and found that it's a bug in the PostgreSQL include files. See this mailing list post.
You can work around it by explicitly defining WIN32 in your project file's preprocessor directives.
See my blog post on the topic today
这篇关于错误C2011:'时区':'结构'重新定义类型(Postgres的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!