gpt4 book ai didi

c++ - VTK - 从 6.1 迁移到 8.2 [2]

转载 作者:行者123 更新时间:2023-11-28 04:21:53 29 4
gpt4 key购买 nike

请看这篇文章:

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 ==========

你能给出一个提示来消除这些链接错误吗?

最佳答案

  • 将您的二进制文件与 dbghelp.lib 链接

    例如如果您使用的是 CMake,请将类似以下行的内容添加到您的 CMakeLists.txt

    target_link_libraries(${project_name} PRIVATE dbghelp.lib)

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

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

    #pragma comment(lib, "dbghelp.lib")//未测试

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

    VTK_REPORT_OPENGL_ERRORS [ ]

关于c++ - VTK - 从 6.1 迁移到 8.2 [2],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55283069/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com