【问题标题】:Error in visual studio about exit declarationVisual Studio 中关于退出声明的错误
【发布时间】:2014-01-10 12:46:53
【问题描述】:

**每次 Visual Studio 2008 运行我使用 opencv 和 opengl 的代码时都会出现此错误:

  • 1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdlib.h(371):错误 C2381:“退出”:重新定义; __declspec(noreturn) 不同

  • 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\gl\glut.h(146) : 参见“退出”声明

  • 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\gl\glut.h(146) : 参见“退出”声明

我该如何解决?**

【问题讨论】:

  • 我们需要的不仅仅是一些错误消息。出现此问题的代码是什么,您链接的库是什么,等等。
  • 这些是我包含的库
  • #include #include #include #include "opencv2/core/core.hpp" #include "opencv2/features2d/features2d.hpp " #include "opencv2/highgui/highgui.hpp" #include "opencv2/calib3d/calib3d.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "math.h" #include 跨度>
  • 我被告知这是一个链接器问题,您知道我该如何解决吗?提前致谢
  • 您需要将它们放在您的实际问题中,而不是在 cmets 中。另外,“您知道我该如何解决吗?”不,你什么都没说。您所说的只是您遇到了一些链接器错误并且您已经包含了某些文件。我们需要查看代码

标签: visual-studio-2008 opengl opencv


【解决方案1】:

尝试将您的#include "Glut.h" 移至包含列表的末尾。

【讨论】:

    【解决方案2】:

    我遇到了同样的问题,我可以通过重新排序包含声明来解决它。确保您的列表顶部的#include <windows.h> 包括然后#include <stdlib.h> 并在您的最终列表中添加#include <GL/glut.h>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-11-27
      • 1970-01-01
      • 2019-03-02
      • 2018-11-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多