【发布时间】:2014-07-18 16:51:14
【问题描述】:
我在 C 代码的顶部编写 MFC-GUI,在从 c 代码中获取 lib 和包含文件后,我收到下面提到的许多变量的重新定义错误-
error C2011: 'fd_set' : 'struct' type redefinition
error C2011: 'timeval' : 'struct' type redefinition
error C2011: 'hostent' : 'struct' type redefinition
error C2011: 'netent' : 'struct' type redefinition
error C2011: 'servent' : 'struct' type redefinition
error C2011: 'protoent' : 'struct' type redefinition
还有更多......
它与代码无关,因为它独立工作正常,所以我需要一些合并配置方面的帮助。 我是怎么做到的—— 我创建了一个新的 MFC 项目 + 解决方案,在其中添加了一个对话框,构建它 - 工作正常;现在我在上述解决方案中添加了一个现有的 C 项目,为添加的 C 项目配置了 MFC 项目。在配置中,我已经给出了所有必需的 Lib 和包含路径。 现在从 MFC 代码中,我试图包含 C 代码文件,它给了我上述错误。
是我遗漏了什么还是我添加了错误的东西?
请帮我解决这个问题。
谢谢。
【问题讨论】:
-
文件定义重复。
标签: c++ c user-interface mfc merge