VTK-从6.1迁移到8.2 [2]

问题描述 投票:0回答:1

[请参阅这篇文章:

VTK - Migrating from 6.1 to 8.2

我设置了所有设置,但只得到3个错误,而且几天之内都无法摆脱它们:

1>------ Build started: Project: MyApp, Configuration: Debug x64 ------
1>   Creating library F:\MyApp\x64\Debug\MyApp.lib and object F:\MyApp\x64\Debug\MyApp.exp
1>MyAppView.obj : warning LNK4217: locally defined symbol ??0vtkMFCWindow@@QEAA@PEAVCWnd@@@Z (public: __cdecl vtkMFCWindow::vtkMFCWindow(class CWnd *)) imported in function "protected: __int64 __cdecl CMyAppView::OnPostInit(unsigned __int64,__int64)" (?OnPostInit@CMyAppView@@IEAA_J_K_J@Z)
1>MyAppView.obj : warning LNK4217: locally defined symbol ??1vtkMFCWindow@@UEAA@XZ (public: virtual __cdecl vtkMFCWindow::~vtkMFCWindow(void)) imported in function "public: virtual void * __cdecl vtkMFCWindow::`scalar deleting destructor'(unsigned int)" (??_GvtkMFCWindow@@UEAAPEAXI@Z)
1>VTKView.obj : warning LNK4217: locally defined symbol ?DrawDC@vtkMFCWindow@@QEAAXPEAVCDC@@@Z (public: void __cdecl vtkMFCWindow::DrawDC(class CDC *)) imported in function "public: virtual void __cdecl CVTKView::OnDraw(class CDC *)" (?OnDraw@CVTKView@@UEAAXPEAVCDC@@@Z)
1>vtkRenderingOpenGL2-8.2.lib(vtkOpenGLState.obj) : error LNK2019: unresolved external symbol __imp_SymGetLineFromAddr64 referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl getProgramStack(void)" (?getProgramStack@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>vtkRenderingOpenGL2-8.2.lib(vtkOpenGLState.obj) : error LNK2019: unresolved external symbol __imp_SymInitialize referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl getProgramStack(void)" (?getProgramStack@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>vtkRenderingOpenGL2-8.2.lib(vtkOpenGLState.obj) : error LNK2019: unresolved external symbol __imp_SymFromAddr referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl getProgramStack(void)" (?getProgramStack@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>F:\MyApp\x64\Debug\MyApp.exe : fatal error LNK1120: 3 unresolved externals
1>Done building project "MyApp.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

您能否提示gt消除这些链接错误?

c++ visual-c++ mfc vtk
1个回答
1
投票
  • 将二进制文件与dbghelp.lib关联

    例如如果使用的是CMake,则将以下内容添加到CMakeLists.txt中。

    target_link_libraries(${project_name} PRIVATE dbghelp.lib)

    或如果不使用CMake,则将其添加到项目中(链接器/输入/其他依赖项)>>

    或将以下内容添加到main.cpp中,包括:

    #pragma comment(lib, "dbghelp.lib") //untested

  • 可能在VTK CMake中关闭VTK错误日志记录也可能有帮助(不确定)

    VTK_REPORT_OPENGL_ERRORS [ ]

© www.soinside.com 2019 - 2024. All rights reserved.