unanswered Static GLEW problems

08 Jul 2018 18:56 #1


Chai3D 3.2.0 has a static version of GLEW built into it. This creates problems when trying to create dynamic libraries based on Chai3D: the GLEW function calls made from the dynamic library have no effect on the global state of GLEW in the application that is using this library and Chai3D. This is due to the way DLL and EXE work on Windows: each entity has access to its own set of global variables. In the end, some things may not work, e.g. shaders cannot be linked.

There are two ways to resolve this problem:

  1. Provide an option for using dynamic GLEW library. This option may be disabled by default to keep the current default behaviour.
  2. Add a note in documentation addressing this issue.

There is also another option: create only static libraries and only call GLEW functions from these libraries. The drawback of this solution is quite obvious: it is impossible to update the library code without full recompilation of the executable. This may not always be desirable.

Best regards,
Innokentiy Alaytsev

Please Log in or Create an account to join the conversation.