OSVR / OSVR-Core

The core libraries, applications, and plugins of the OSVR software platform.
Apache License 2.0
329 stars 124 forks source link

fix gcc compiler error about for loop initial declaration #545

Closed gfrolov closed 7 years ago

godbyk commented 7 years ago

If you instead add the following to the CMakeLists.txt file, does it compile as is?

set(CMAKE_C_STANDARD 11) # 99 or 03 or whichever standard you're aiming for
set(CMAKE_C_STANDARD_REQUIRED ON)
gfrolov commented 7 years ago

@godbyk , The client examples are compiled all together in CMakeLists, so it would be applied to all of them at once. Ryan brought up a point that MSVC C compiler doesn't support 99 for example, so that's why I'm just fixing this one example.

godbyk commented 7 years ago

@mars979 MSVC C compiler doesn't support all of C99 (or all of any C standard, as far as I'm aware), but it does support initializations in for loops.

I'm not concerned about this single example, but about solving the problem going forward.