I've changed one of my classes adding a method and some includes, after doing this I'm getting a lot of undefined or missing errors for things that haven't problems and worked well until then.
This is the header file where I get the error:
assetloader.h
#ifndef LS_ASSETLOADER_H
#define LS_ASSETLOADER_H
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#include <assimp/types.h>
#include <glm/glm.hpp>
#include <vector>
//these are the headers that give me problems
//#include "scene.h"
//#include "model.h"
//the 2 methods below are commented so i don't get errors for missing Scene
class AssetLoader {
//void importScene(aiNode* node, ls::Scene* scene, const aiScene* aScene);
public:
bool loadMesh(
const char* path,
std::vector<glm::vec3>* vertices,
std::vector<glm::vec3>* normals,
std::vector<glm::vec2>* uvs
);
// bool loadScene(const char* path, ls::Scene* scene);
};
#endif
these other two are the scene and model headers:
scene.h
#ifndef LS_SCENE_H
#define LS_SCENE_H
#include <vector>
#include "camera.hpp"
#include "light.h"
#include "model.h"
namespace ls {
class Scene;
}
class ls::Scene {
std::vector<Camera*> _camera;
std::vector<Light*> _light;
std::vector<Model*> _model;
unsigned int _activeCamera;
public:
Scene();
void addCamera(Camera* camera);
void addLight(Light* light);
void addModel(Model* model);
void draw();
};
#endif
model.h
#ifndef LS_MODEL_H
#define LS_MODEL_H
#include "mesh.h"
#include "material.h"
#include "renderer.h"
#include <glm/glm.hpp>
class Model {
Mesh* _mesh;
Material* _material;
Renderer* _renderer;
glm::mat4 _transform;
public:
Model(Mesh* mesh, Material* material);
Renderer* renderer() const;
glm::mat4 transform() const;
void setPosition(glm::vec3 position);
void translate(glm::vec3 translation);
void scale(glm::vec3 factor);
void setRotation(glm::vec3 axis, float angle);
};
#endif
mesh.h
#ifndef LS_MESH_H
#define LS_MESH_H
#include <vector>
#include <glm/glm.hpp>
#include "assetloader.h"
#include "texture2D.h"
class Mesh {
std::vector<glm::vec3> _vertices;
std::vector<glm::vec3> _normals;
std::vector<glm::vec2> _uvs;
public:
Mesh(const char* path);
Mesh();
int numVertices() const;
std::vector<glm::vec3> vertices() const;
void setVertices(std::vector<glm::vec3> vertices);
std::vector<glm::vec2> uvs() const;
void setUVs(std::vector<glm::vec2> uvs);
void setNormals(std::vector<glm::vec3> normals);
std::vector<glm::vec3> normals() const;
};
#endif
I have not included the .cpp files cause i don't think is there the problem (I haven't modified them from last time they worked).
Here are some samples of the error i get (i haven't included all of them cause they are too much and are similar to these ones):
1>c:\users\chip\documents\visual studio 2010\projects\letsstart\letsstart\model.h(10): error C2143: syntax error : missing ';' before '*'
1>c:\users\chip\documents\visual studio 2010\projects\letsstart\letsstart\model.h(10): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\chip\documents\visual studio 2010\projects\letsstart\letsstart\model.h(10): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\chip\documents\visual studio 2010\projects\letsstart\letsstart\model.h(12): error C2143: syntax error : missing ';' before '*'
1>c:\users\chip\documents\visual studio 2010\projects\letsstart\letsstart\model.h(12): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\chip\documents\visual studio 2010\projects\letsstart\letsstart\model.h(12): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\chip\documents\visual studio 2010\projects\letsstart\letsstart\model.h(17): error C2061: syntax error : identifier 'Mesh'
1>c:\users\chip\documents\visual studio 2010\projects\letsstart\letsstart\model.h(18): error C2143: syntax error : missing ';' before '*'
1>c:\users\chip\documents\visual studio 2010\projects\letsstart\letsstart\model.h(18): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\chip\documents\visual studio 2010\projects\letsstart\letsstart\model.h(18): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int