Skip to content

VS 2015 error C2131: expression did not evaluate to a constant #1226

@dpshamonin

Description

@dpshamonin

Describe your issue

Dear Devs,
There is a compilation error in
libigl\src\include\igl\opengl\glfw\imgui\ImGuiTraits.h
for Visual Studio 2015 update 3, see below:

libigl\src\include\igl\opengl\glfw\imgui\ImGuiTraits.h(29): error C2131: expression did not evaluate to a constant
libigl\src\include\igl\opengl\glfw\imgui\ImGuiTraits.h(29): note: failure was caused by unevaluable pointer value
...
libigl\src\include\igl\opengl\glfw\imgui\ImGuiTraits.h(64): error C2131: expression did not evaluate to a constant
libigl\src\include\igl\opengl\glfw\imgui\ImGuiTraits.h(64): note: failure was caused by unevaluable pointer value

It appears can be fixed by declaring format as a pointer instead of array:

static constexpr char *format = "%d";

at the following line:

https://github.com/libigl/libigl/blob/master/include/igl/opengl/glfw/imgui/ImGuiTraits.h#L29

And five other places in this file. It looks like a Visual Studio 2015 compiler bug,

Regards,
Denis
...

Check all that apply (change to [x])

  • [x ] Windows
  • Mac OS X
  • Linux
  • I have tried the dev branch and the problem persists

See https://libigl.github.io/CONTRIBUTING/#bugreport for more tips.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions