[vtkusers] OpenGL2 linking issues with VTK 7.1.1 and 8.1.0 for Windows 10

Thuc Bui bui at calcreek.com
Sat Feb 3 17:36:40 EST 2018

Hi David,


Thank you so much for getting back to me. I searched the VTK 7.1.1 distribution and did not find vtkRenderingOpenGLModule.h, but found vtkRenderingOpenGL2Module.h in the directory Rendering\OpenGL2. So I cheat by generating 2 dummy functions with OpenGL signatures, and in them simply calling their OpenGL2 counterpart in vtkRenderingOpenGL2ObjectFactory.cxx. This workaround gets my codes compiled and linked.


Many thanks for your help,



From: David Gobbi [mailto:david.gobbi at gmail.com] 
Sent: Saturday, February 03, 2018 1:12 PM
To: tb
Cc: VTK Users
Subject: Re: [vtkusers] OpenGL2 linking issues with VTK 7.1.1 and 8.1.0 for Windows 10


Hi Thuc,


The vtkRenderingOpenGL_AutoInit_Construct method is declared via the VTK_AUTOINIT() macro in vtkRenderingOpenGLModule.h.  If I recall correctly, if a project includes any header from Rendering/OpenGL (either directly or indirectly) then your project will look for the vtkRenderingOpenGL_AutoInit methods.


The strange thing is, if you have an OpenGL2 build of VTK, then the vtkRenderingOpenGLModule.h header should not even exist.  But since you are getting this build error, it seems that this header does exist, and your project is indirectly including it somehow.


Do a search of your VTK installation to make sure that vtkRenderingOpenGL2Module.h exists and that vtkRenderingOpenGLModule.h does not exists.


 - David




On Sat, Feb 3, 2018 at 1:26 PM, tb <bui at calcreek.com> wrote:

Dear VTK community,

I have been trying to migrate from VTK 6.3.0 to 7.1.1 and even 8.1.0 in
Windows 10 x64 platform. Both versions cause the linking issues with two
functions that are no longer exist in either version distribution. I have
also made sure my codes reference and link only to the OpenGL2 directories.
These two functions, vtkRenderingOpenGL_AutoInit_Construct and
vtkRenderingOpenGL_AutoInit_Destruct are not found any where in either
header or source files in v7.1.1 distribution (although they are found in
6.3.0 containing in the source file
OpenGL\vtkRenderingOpenGLObjectFactory.cxx). Do I need to include some other
packages in CMake to resolve these linking issues? Currently, in CMake I
have only the following module built, vtkGUISupportMFC. Are there some
options in CMake that I neglect to enable? I have used the default settings
except for enabling CMAKE_CXX_MP_FLAG and VTK_USE_CXX11_FEATURES.

Many thanks,
Thuc Bui

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180203/3de338e5/attachment.html>

More information about the vtkusers mailing list