[vtkusers] 答复: Init in VTK 8.0

Wang Q wangq1979 at outlook.com
Tue Oct 31 12:26:47 EDT 2017


Hello Shawn,

Your tips really help! But I cannot find the script under the dir as you mentioned. I wonder it has been moved to somewhere else in VTK 8.

Best wishes,

Chiang

________________________________
发件人: Shawn Waldon <shawn.waldon at kitware.com>
发送时间: 2017年10月31日 15:51
收件人: Wang Q
抄送: vtkusers at vtk.org
主题: Re: [vtkusers] Init in VTK 8.0

Hi Chiang,

VTK's default rendering implementation changed from VTK 6 to VTK 7, so the library names you need changed.  The OpenGL backend worked with OpenGL 1.1(or 1.2?), and the newer OpenGL2 backend uses OpenGL 3.2.  The default changed to OpenGL2 in VTK 7.0 and so you need to update the names of the libraries you are using from vtkRenderingOpenGL and vtkRenderingVolumeOpenGL to vtkRenderingOpenGL2 and vtkRenderingVolumeOpenGL2.  There is a script you can run in the VTK source tree (Utilities/Scripts/WhatModulesVTK.py) to figure out what modules you need to use.  I'd run that script and see what you get since I'm not sure if anything else you use has changed.

HTH,
Shawn

On Tue, Oct 31, 2017 at 8:11 AM, Wang Q <wangq1979 at outlook.com<mailto:wangq1979 at outlook.com>> wrote:
Hello there,

I upgraded VTK from 6.3 to 8.0, and tried to execute some legacy code implemented on 6.3. However, after setting up the project include and lib dirs in VS2015, it threw some errors like:

Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol "void __cdecl vtkRenderingOpenGL_AutoInit_Construct(void)" (?vtkRenderingOpenGL_AutoInit_Construct@@YAXXZ) test_vtk D:\develop\C++\projects\test_vtk\test_vtk\test_vtk\Vis3D3Phase_WithPipe.obj 1

My code starts like:
#pragma

#include <vtkAutoInit.h>
VTK_MODULE_INIT(vtkInteractionStyle);
VTK_MODULE_INIT(vtkRenderingOpenGL);
VTK_MODULE_INIT(vtkRenderingVolumeOpenGL);
VTK_MODULE_INIT(vtkRenderingFreeType);

#include "vtkSmartPointer.h"
#include "vtkImageData.h"

It seems libs are not recognised, but I did update all relating parameters in VS project properties.


In addition, I tried the example of vtkShadows, but unfortunately it said unresolved header file "vtkFrameBufferObject.h".

Any tips would be appreciated!

Cheers,

Chiang

_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20171031/21df692f/attachment.html>


More information about the vtkusers mailing list