I'm following an OpenGL tutorial and I have a simple .h file where I made a struct that makes up the format for a vertex. I'm getting an incomplete type error at a glm::vec3 field. This is the first time I try to use the glm library. Do you have any idea what am I missing out?
I read some answers about incomplete types, but all of them seem to be talking about recursive inclusion, which I don't seem to have.
#pragma once
#include <glm/glm.hpp>
struct VertexFormat {
glm::vec3 position; //error here
VertexFormat(const glm::vec3 &pos) {
position = pos; //and here
}
};
The word vec3 is underlined with "Type 'glm::vec<3, float, 0>' is incomplete" and then the word position with "Cannot assign to an incomplete type 'glm::vec<3, float, 0>'"
Edit: The problem is in the IDE - I just commented other unfinished parts of the code so that I can compile, tried to write some code using VertexFormat and it compiles and runs just fine (still stays underlined with red though). I'm using Visual Studio 2017 with ReSharper Ultimate extension. I downloaded glm from the official website and since the lib is header only I just copied the glm folder with header files into my solution directory inside /include where I also have another folder GL with GLEW and FreeGLUT in it (which work fine). The glm.hpp #includes all other glm headers in it. In project properties I have $(SolutionDir)/include as an additional include directory.
Please update to the latest ReSharper version - there was a bug in the initial 2019.1 release which could cause this (see RSCPP-26279 for details).