Errors while compiling GLM in project

Hello All,

I am using glm 0.9.2.7 with VS 2010. In the code, I just include “#include <glm/glm.hpp>” statement.

When I try to compile the code, VS throws errors like:

[list]
[li]C2988: unrecognizable template declaration/definition func_common.hpp 251[/li][li]error C2027: use of undefined type ‘genType’ func_common.hpp 251[/li][li]error C2332: ‘union’ : missing tag name glm\core\func_common.inl 1311[/li]
And many others like these. The first two are about isinf method. And the last one is about the unions.

Any idea about the cause of these errors?

Did you have issues as well with GLM 0.9.2.6 or another older version?

GLM 0.9.2.7 have been tested on Visual C++ 2010 with and without /Za so it should work.

Do you define “isinf” in your own code with a define?

I started directly with 9.2.7. I will try 9.2.6 and let you know.

And I haven’t defined isinf in the code.

Hi, I tried 9.2.6 as well. Still same errors. The errors I receive are like the following:

1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm./core/func_common.hpp(251): error C2027: use of undefined type ‘genType’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm./core/func_common.hpp(251): error C2988: unrecognizable template declaration/definition
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm./core/func_common.hpp(251): error C2059: syntax error : ‘(’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1255): error C2027: use of undefined type ‘genType’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1255): error C2988: unrecognizable template declaration/definition
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1255): error C2059: syntax error : ‘(’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1270): error C2974: ‘glm::detail::tvec2’ : invalid template argument for ‘T’, type expected
1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core ype_vec2.hpp(32) : see declaration of ‘glm::detail::tvec2’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1273): error C2974: ‘glm::detail::tvec2’ : invalid template argument for ‘T’, type expected
1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core ype_vec2.hpp(32) : see declaration of ‘glm::detail::tvec2’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1273): error C2974: ‘glm::detail::tvec2’ : invalid template argument for ‘T’, type expected
1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core ype_vec2.hpp(32) : see declaration of ‘glm::detail::tvec2’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1274): error C2143: syntax error : missing ‘;’ before ‘{’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1274): error C2447: ‘{’ : missing function header (old-style formal list?)
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1281): error C2027: use of undefined type ‘glm::detail::tvec3’
1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core ype_vec3.hpp(32) : see declaration of ‘glm::detail::tvec3’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1281): error C2988: unrecognizable template declaration/definition
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1281): error C2059: syntax error : ‘(’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1297): error C2143: syntax error : missing ‘;’ before ‘{’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1297): error C2447: ‘{’ : missing function header (old-style formal list?)
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1311): error C2143: syntax error : missing ‘;’ before ‘identifier’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1311): error C2332: ‘union’ : missing tag name
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1311): error C3306: ‘glm::core::function::common::floatBitsToInt::<unnamed-tag>’: unnamed class template is not allowed
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1311): error C2079: ‘$S1’ uses undefined union ‘glm::core::function::common::floatBitsToInt::<unnamed-type-$S1>’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1311): error C2065: ‘fi’ : undeclared identifier
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1313): error C2065: ‘fi’ : undeclared identifier
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1314): error C2065: ‘fi’ : undeclared identifier
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1356): error C2143: syntax error : missing ‘;’ before ‘identifier’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1356): error C2332: ‘union’ : missing tag name
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1356): error C3306: ‘glm::core::function::common::floatBitsToUint::<unnamed-tag>’: unnamed class template is not allowed
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1356): error C2079: ‘$S2’ uses undefined union ‘glm::core::function::common::floatBitsToUint::<unnamed-type-$S2>’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1356): error C2065: ‘fu’ : undeclared identifier
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1358): error C2065: ‘fu’ : undeclared identifier
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1359): error C2065: ‘fu’ : undeclared identifier
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1401): error C2143: syntax error : missing ‘;’ before ‘identifier’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1401): error C2332: ‘union’ : missing tag name
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1401): error C3306: ‘glm::core::function::common::intBitsToFloat::<unnamed-tag>’: unnamed class template is not allowed
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1401): error C2079: ‘$S3’ uses undefined union ‘glm::core::function::common::intBitsToFloat::<unnamed-type-$S3>’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1401): error C2065: ‘fi’ : undeclared identifier
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1403): error C2065: ‘fi’ : undeclared identifier
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1404): error C2065: ‘fi’ : undeclared identifier
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1446): error C2143: syntax error : missing ‘;’ before ‘identifier’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1446): error C2332: ‘union’ : missing tag name
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1446): error C3306: ‘glm::core::function::common::uintBitsToFloat::<unnamed-tag>’: unnamed class template is not allowed
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1446): error C2079: ‘$S4’ uses undefined union ‘glm::core::function::common::uintBitsToFloat::<unnamed-type-$S4>’
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1446): error C2065: ‘fu’ : undeclared identifier
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1448): error C2065: ‘fu’ : undeclared identifier
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\glm\core\func_common.inl(1449): error C2065: ‘fu’ : undeclared identifier

Do you want to use GLM within the Windows SDK?

My experience of Microsoft being able to do define float and include stone age STL implementation with their SDK might explain some things here.

I think I figured what the problem was. At some point of my code, I was also using TAUCS. Refering to your previous answer, I guess TAUCS was also defining “isinf”. I removed TAUCS includes and it compiled. I will let you know if something else pops up.

Thanks