gpt4 book ai didi

c++ - 使用 visual studio 2012 初始化 openGL 时遇到问题

转载 作者:行者123 更新时间:2023-11-28 07:50:48 24 4
gpt4 key购买 nike

对于我的包含,我有以下内容

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cmath>
#include <GL/glut.h>
#include <GL/gl.h>
#include <GL/glu.h>

但是,当我尝试编译时,我遇到了一大堆错误,这些错误与我正在使用的任何源代码都无关。

错误 1 ​​error C2825: '_Iter': 后跟 '::' 时必须是类或命名空间 c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility 364 1 mp4

错误 2 error C2039: 'iterator_category' : is not a member of '`global namespace'' c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility 364 1 mp4

错误 3 错误 C2146:语法错误:缺少“;”在标识符“iterator_category”之前 c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility 364 1 mp4

错误 4 error C2602: 'std::iterator_traits<_Iter>::iterator_category' 不是 'std::iterator_traits<_Iter> 基类的成员 c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility 364 1 mp4

错误 5 error C2868: 'std::iterator_traits<_Iter>::iterator_category' : using-declaration 的非法语法;预期的合格名称 c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility 364 1 mp4

...等...

我不确定 xutility 文件是什么,或者为什么编译器会提示它。我高度怀疑这与我使用 VS 2012 设置 openGL 的方式有关,但我不确定。谁能发现我的包含有问题?

最佳答案

而不是-

#include <GL/glut.h>
#include <GL/gl.h>
#include <GL/glu.h>

只需使用-

#include <GL/GL.h>

关于c++ - 使用 visual studio 2012 初始化 openGL 时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13826312/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com