在Visual Studio 2013 C++中,我已经清楚地定义了一个类,并且收到错误说它不是一个类
In Visual Studio 2013 C++ I have clearly defined a class and am receiving errors saying that it is not a class
这是我的类(mesh)的头文件
#ifdef MESH_H
#define MESH_H
#include <glmglm.hpp>
#include <GLglew.h>
class Vertex
{
public:
Vertex(const glm::vec3& pos)
{
this->pos = pos;
}
protected:
private:
glm::vec3 pos;
};
class Mesh
{
public:
Mesh(Vertex* vertices, unsigned int numVertices);
void Draw();
virtual ~Mesh();
protected:
private:
Mesh(const Mesh& other);
void operator = (const Mesh& other);
enum
{
POSITION_VB,
NUM_BUFFERS
}
GLuint g_vertexArrayObject;
GLuint g_vertexArrayBuffers(NUM_BUFFERS);
unsigned int g_drawCount;
};
#endif
这是我得到的主要错误。所有其他错误都基于此错误。
Error 1 error C2653: 'Mesh' : is not a class or namespace name
请帮助我,因为这毫无意义,因为我已将"网格"明确定义为一个类。 谢谢
您的类实际上并未定义。我认为#ifdef MESH_H
应该#ifndef MESH_H
相关文章:
- 试图在visual studio上用C++创建一个桌面应用程序
- visual是否可以在c++中创建一个接收无限数量相同类型(或至少相当数量)参数的函数
- 使用Visual Studio在虚幻引擎中创建一个新的类c ++给了我太多的错误
- 在 Visual Studio 中构建一个没有 C/C++ 运行时的静态库
- 无法从 Visual Studio C++ 中的另一个类访问一个类
- Visual Studio Debug 只在一个线程中
- 如何创建一个windows visual Studio C++/CX NOT UWP
- 在Visual Studio中,与std::async一起使用时不调用"thread_local"变量"析构函数,这是一个错误吗?
- Visual Studio 2017 STL 可视化工具失败了一个 std::map<MyIntrusivePtr, std::tuple<....> >
- Visual Studio 2017 C++,如何定义一个"环境变量"'Additional Library Directory'?
- 如何在Visual Studio C++中声明一个二维字符串数组?
- 从命令行构建一个.sln / .vcxproj项目,并使用Visual C 的免费版本构建
- 在另一个文件中定义函数后,Visual Studio 无法识别该函数
- 使用命令行构建一个Visual Studio C 项目
- 让C++程序构建一个Visual C++项目,而无需使用system
- 在visual c++2010项目中包含一个visual c++6.0头文件
- 交叉编译从linux到windows的一个visual studio项目
- 我可以用xbuild在Linux上编译一个Visual c++项目吗?
- C++结构成员模板函数的显式专用化 - 这是一个Visual Studio问题吗?
- 如何建立一个Visual Studio 2010项目,为Slickedit 17构建64位扩展dll ?