错误:“警告C4005:'SWIGTEMPLATEDISAMBIGUATOR':宏重新定义" [英] Error: "warning C4005: 'SWIGTEMPLATEDISAMBIGUATOR': macro redefinition"

查看:298
本文介绍了错误:“警告C4005:'SWIGTEMPLATEDISAMBIGUATOR':宏重新定义"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编译SWIG项目,并且该项目不断出现这样的错误:

I'm trying to compile a SWIG project, and it keeps on giving errors like this:

swig_wrap.cpp(55):警告C4005:'SWIGTEMPLATEDISAMBIGUATOR':宏 重新定义

swig_wrap.cpp(55): warning C4005: 'SWIGTEMPLATEDISAMBIGUATOR': macro redefinition

还有这样的错误:

严重错误C1010:寻找预编译文件时文件意外结束 标头.您是否忘记在源中添加"#include"stdafx.h""?

fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?

编译器

  • Visual Studio 2015+更新3.
  • SWIG v3.0.12
  • Compiler

    • Visual Studio 2015+Update 3.
    • SWIG v3.0.12
    • 推荐答案

      将以下内容添加到您的.i文件中:

      Add the following to your .i file:

      %begin %{
      #include "stdafx.h"
      %}
      

      本节将代码注入到文件顶部的生成的包装中,您无需禁用预编译的标头.

      This section injects code into the generated wrapper at the top of the file and you won't need to disable pre-compiled headers.

      这篇关于错误:“警告C4005:'SWIGTEMPLATEDISAMBIGUATOR':宏重新定义"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆