Visual Stuido 2010 typedefs in linmath.h

partlycloudy wrote on Sunday, January 03, 2016:

I hope this is not off-topic here, since this is the only forum I could find… just downloaded glfw-3.1.2 source zip, used CMAKE to creat the solution, opened in VS 2010 and ran a build. VS is failling on 5 builds, all because it appears to have issues with the typedefs on the matrix declarations. Since those fail, of course I have many undeclared variables…

Sample output:

3> All outputs are up-to-date.
3>ClCompile:
3> boing.c
10>------ Build started: Project: threads, Configuration: Debug Win32 ------
4>InitializeBuildStatus:
4> Creating “clipboard.dir\Debug\clipboard.unsuccessfulbuild” because “AlwaysCreate” was specified.
4>CustomBuild:
4> All outputs are up-to-date.
9>Build started 1/3/2016 1:37:16 PM.
4>ClCompile:
4> All outputs are up-to-date.
7>Build started 1/3/2016 1:37:17 PM.
9>InitializeBuildStatus:
3>C:\development\GLFW\glfw-3.1.2\deps\linmath.h(196): error C2275: ‘mat4x4’ : illegal use of this type as an expression
3> C:\development\GLFW\glfw-3.1.2\deps\linmath.h(83) : see declaration of 'mat4x4’
3>C:\development\GLFW\glfw-3.1.2\deps\linmath.h(196): error C2146: syntax error : missing ‘;’ before identifier 'T’
3>C:\development\GLFW\glfw-3.1.2\deps\linmath.h(196): error C2065: ‘T’ : undeclared identifier
3>C:\development\GLFW\glfw-3.1.2\deps\linmath.h(197): error C2065: ‘T’ : undeclared identifier
3>C:\development\GLFW\glfw-3.1.2\deps\linmath.h(197): warning C4047: ‘function’ : ‘vec4 (*)’ differs in levels of indirection from 'int’
3>C:\development\GLFW\glfw-3.1.2\deps\linmath.h(197): warning C4024: ‘mat4x4_from_vec3_mul_outer’ : different types for formal and actual parameter 1
3>C:\development\GLFW\glfw-3.1.2\deps\linmath.h(199): error C2275: ‘mat4x4’ : illegal use of this type as an expression
3> C:\development\GLFW\glfw-3.1.2\deps\linmath.h(83) : see declaration of ‘mat4x4’

There are many more, of course: wherever the linmath.h is used, I expect.

Did not want to define it as a bug, since I am very out-of-practice on VS 2010 (VS in general).

Any info would be appreciated!

Note that I was only running my own compile because I was getting the previously reported error when I tried to use the pre-built library:

1>glfw3.lib(monitor.c.obj) : error LNK2019: unresolved external symbol __libm_sse2_pow_precise referenced in function _glfwSetGamma
1>C:\development\GLFWTest\Debug\GLFWTest.exe : fatal error LNK1120: 1 unresolved externals

And the tweaks I saw (verified static, made sure win32 env, etc.) did not help. I did see some odd advice about using dll’s then moving to something else…

-Mike

We’re in this together bro, have you gotten any idea how to solve it?

Note that linmath.h is only required by the examples, so if you only want to build the library you can simply skip building the examples. You do this with:

cmake -D GLFW_BUILD_EXAMPLES=OFF ..

where … is the path to the dir where you have cmakelists.txt for GLFW.

This should be fixed now.
https://github.com/glfw/glfw/commit/65d4652e9264a61e8ab5b4e335915e4ae166b7ec