Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue including #include <glm/gtc/quaternion.hpp> #2

Closed
gbarnes opened this issue Sep 26, 2012 · 5 comments
Closed

Issue including #include <glm/gtc/quaternion.hpp> #2

gbarnes opened this issue Sep 26, 2012 · 5 comments
Assignees
Labels

Comments

@gbarnes
Copy link

gbarnes commented Sep 26, 2012

Everytime I try to include #include glm/gtc/quaternion.hpp I get alot of errors:

Error 1 error C2059: syntax error : 'constant' glm\gtc\quaternion.hpp 59 1

Error 2 error C2143: syntax error : missing ';' before '}' glm\gtc\quaternion.hpp 59 1

Error 3 error C2238: unexpected token(s) preceding ';' glm\gtc\quaternion.hpp 59 1

Error 4 error C2039: 'length' : is not a member of 'glm::detail::tquat' glm\gtc\quaternion.inl 38 1

Error 5 error C2039: '{ctor}' : is not a member of 'glm::detail::tquat' glm\gtc\quaternion.inl 46 1

Warning 6 warning C4346: '{ctor}' : dependent name is not a type glm\gtc\quaternion.inl 51 1

Error 7 error C2061: syntax error : identifier 'value_type' glm\gtc\quaternion.inl 51 1

Error 8 error C2039: '{ctor}' : is not a member of 'glm::detail::tquat' glm\gtc\quaternion.inl 58 1

Warning 9 warning C4346: '{ctor}' : dependent name is not a type glm\gtc\quaternion.inl 63 1

Error 10 error C2061: syntax error : identifier 'value_type' glm\gtc\quaternion.inl 63 1

Error 11 error C2039: '{ctor}' : is not a member of 'glm::detail::tquat' glm\gtc\quaternion.inl 72 1

Error 12 error C2039: '{ctor}' : is not a member of 'glm::detail::tquat'glm\gtc\quaternion.inl 108 1

Error 13 error C2039: '{ctor}' : is not a member of 'glm::detail::tquat' glm\gtc\quaternion.inl 117 1

Error 14 error C2039: '{ctor}' : is not a member of 'glm::detail::tquat' glm\gtc\quaternion.inl 126 1

Error 15 error C2039: '[]' : is not a member of 'glm::detail::tquat' glm\gtc\quaternion.inl 135 1

Error 16 error C2039: '[]' : is not a member of 'glm::detail::tquat' glm\gtc\quaternion.inl 141 1

Error 17 error C2065: 'value_type' : undeclared identifier glm\gtc\quaternion.inl 149 1

Warning 18 warning C4346: 'glm::detail::tquat::*=' : dependent name is not a type glm\gtc\quaternion.inl 149 1

Error 19 error C2143: syntax error : missing ')' before 'const' glm\gtc\quaternion.inl 149 1

Error 20 error C2039: '*=' : is not a member of 'glm::detail::tquat' glm\gtc\quaternion.inl 149 1

I don't know if I'm missing something or not but generally I just included the header files and included #include glm/gtc/type_ptr.hpp since I need the glm::value_ptr to get the pointer to the matrices.

I get another error in the rotate functionality which uses detail::tmat4x4 Rotate(detail::tmat4x4::null);

but it seems that it cant find detail::tmat4x4::null ... I'm new to C++.

@Groovounet
Copy link
Member

Hi,

What compiler are you using?

Thanks,
Christophe

@gbarnes
Copy link
Author

gbarnes commented Sep 26, 2012

I'm using Visual Studio 2012 with the following Platform Toolsets: Visual Studio 2012 (v110). Sry, forgotten to mention it :)

@Groovounet
Copy link
Member

erm... I actually really don't understand what's causing this issue...

Can you try GLM 0.9.4 branch https://github.com/g-truc/glm/zipball/0.9.4 and confirm the problem?

If you still have an issue can you send me a code to reproduce the issue?

Thanks,
Christophe

@gbarnes
Copy link
Author

gbarnes commented Sep 26, 2012

I tried it and visual studio still gives me the same errors.

I'm using DirectX 9 and OpenGL 4.3 ... its a very large code base but I'm using the following code:

GlobalHeader.h:
#include < glm\glm.hpp > <-- this is included in a global source file

in the global header file I've the following typedefs:
typedef glm::vec3 dmVector3;
typedef glm::vec2 dmVector2;
typedef glm::vec4 dmVector4;
typedef glm::mat4x4 dmMatrix4;

dmGLTriangleNode.cpp:

#include < glm/gtc/matrix_transform.hpp >
#include < glm/gtc/type_ptr.hpp >

glm::mat4 trans = glm::rotate(dmMatrix4(1.0f), mAngle*=0.4f , VECTOR_UP);
this->VSetTransform(&trans, null);

this->mShader.VBind();

int locationProjection = this->mShader.GetLocation("projectionMatrix");
int locationView = this->mShader.GetLocation("viewMatrix");
int locationToWorld = this->mShader.GetLocation("toWorldMatrix");

glUniformMatrix4fv(locationProjection, 1, GL_FALSE, glm::value_ptr(pScene->GetCamera()->GetProjection()));
glUniformMatrix4fv(locationView, 1, GL_FALSE, glm::value_ptr(pScene->GetCamera()->GetView()));
glUniformMatrix4fv(locationToWorld, 1, GL_FALSE, glm::value_ptr(this->mProperties.ToWorld()));

whenever I use glm::value_ptr(); it gives me the error with the quaternion.hpp since there is a overloaded function for quaternions. I excluded the overload function of value_ptr and it works but ran into another issue with the glm::rotate function as described above.

@Groovounet
Copy link
Member

Hi,

I still have no solution for you... Is there any chance that your application is actually defining "value_ptr" with a define?

Thanks,
Christophe

@ghost ghost assigned Groovounet Dec 13, 2012
Groovounet pushed a commit that referenced this issue Feb 19, 2015
amaury-ml pushed a commit to amaury-ml/glm that referenced this issue Aug 27, 2019
Galbegue pushed a commit to Galbegue/glm that referenced this issue Jan 6, 2024
sharkautarch added a commit to sharkautarch/glm that referenced this issue Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants