# Visual Stuido 2010 typedefs in linmath.h

**URL:** <https://discourse.glfw.org/t/visual-stuido-2010-typedefs-in-linmath-h/185>\
**Category:** support\
**Created:** [January 3, 2016, 7:00pm UTC](https://discourse.glfw.org/t/visual-stuido-2010-typedefs-in-linmath-h/185 "2016-01-03T19:00:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [January 3, 2016, 7:00pm UTC](https://discourse.glfw.org/t/visual-stuido-2010-typedefs-in-linmath-h/185/1 "2016-01-03T19:00:59Z")

</div>

**[partlycloudy](https://sourceforge.net/u/partlycloudy/)** wrote on [Sunday, January 03, 2016](https://sourceforge.net/p/glfw/discussion/247562/thread/e544904d/#75cd):

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

---

<div class="post-metadata">

**Author:** ![hafizhmakmur](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@hafizhmakmur](https://discourse.glfw.org/u/hafizhmakmur)\
**Post date:** [June 24, 2016, 4:19pm UTC](https://discourse.glfw.org/t/visual-stuido-2010-typedefs-in-linmath-h/185/2 "2016-06-24T16:19:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [June 25, 2016, 9:04am UTC](https://discourse.glfw.org/t/visual-stuido-2010-typedefs-in-linmath-h/185/3 "2016-06-25T09:04:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![elmindreda](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/elmindreda/32/26_2.png) [@elmindreda](https://discourse.glfw.org/u/elmindreda)\
**Post date:** [July 11, 2016, 11:12pm UTC](https://discourse.glfw.org/t/visual-stuido-2010-typedefs-in-linmath-h/185/4 "2016-07-11T23:12:31Z")

</div>

This should be fixed now.  
[https://github.com/glfw/glfw/commit/65d4652e9264a61e8ab5b4e335915e4ae166b7ec](https://github.com/glfw/glfw/commit/65d4652e9264a61e8ab5b4e335915e4ae166b7ec)
