linmath.h icon indicating copy to clipboard operation
linmath.h copied to clipboard

Compiling with Visual Studio 2012

Open ghost opened this issue 11 years ago • 2 comments

Hi,

I was looking for a small but efficient GLSL friendly C library, and found yours very useful. I just wanted to point out couple of things regarding the compilation with the Visual Studio 2012 Express, as C code:

  • 'inline' needs to be substituted with '__inline'
  • a couple of matrix declarations just need to be shifted before the first function call take place ('mat4x4 S ...;' and 'mat4x4 C;' in 'mat4x4_rotate' fun)

ghost avatar May 23 '13 09:05 ghost

linmath.h is meant to be used using a C99 compiler, where mixed declaration is allowed. Also the inline keyword is part of C99 as well. Yes, I admit that for use with C++ this library needs some adjustments, but using a modern C compiler, with C99 mode enabled, it works just fine.

datenwolf avatar Oct 12 '13 14:10 datenwolf

Yes, the thing is that Visual Studio has a very bad support for C99. According to MS, this should change with VS 2013 edition, and hopefully it will get a real C99 compile mode.

ghost avatar Oct 14 '13 13:10 ghost