g3logger.lib error link on Visual Studio 2022

Dear All,

I build imstk for usual development in C++ on Windows 11. I correctly build imstk (Visual Studio 2022, RelwithDebugInfo).

Now, I am tring to create my custom project using the builded imstk, but I am getting this error about g3logger.lib:

1>g3logger.lib(stacktrace_windows.obj) : error LNK2001: unresolved external symbol __imp_StackWalk64
1>g3logger.lib(stacktrace_windows.obj) : error LNK2001: unresolved external symbol __imp_SymCleanup
1>g3logger.lib(stacktrace_windows.obj) : error LNK2001: unresolved external symbol __imp_SymFunctionTableAccess64
1>g3logger.lib(stacktrace_windows.obj) : error LNK2001: unresolved external symbol __imp_SymGetModuleBase64
1>g3logger.lib(stacktrace_windows.obj) : error LNK2001: unresolved external symbol __imp_SymGetLineFromAddr64
1>g3logger.lib(stacktrace_windows.obj) : error LNK2001: unresolved external symbol __imp_SymInitialize
1>g3logger.lib(stacktrace_windows.obj) : error LNK2001: unresolved external symbol __imp_SymFromAddr

I have correctly linked all the other LIB files available in the install/lib folder.
Could you help me?

Thanks in advance,

Andrea

Hi andrea could you provide a little bit more information, are you trying to set up a second separate project that utilizes imstk (i.e. two separate builds) ?

How did you set up the project that you are building, did you use the template project here https://gitlab.kitware.com/iMSTK/imstkexternalprojecttemplate ? While I haven’t used that in a while it gets built through the CI process and should work correctly.

Otherwise i’d have to look at the cmake, that you are using

Hi Andrea:
I had similar problem in vs2019 and i fixed it with linking dbghelp.lib
Hope this information can help you.

Hi Harald,

I fixed the problem using cmake instead of the standard tool of visual studio to compile the project.
Thank you very much for the template. I will try to use it for future tests and projects based on IMSTK.

Hi Han,

yes, I agree with you. I linked the dbghelp.lib file using cmake and it works now.

target_link_libraries(CMakeTarget PRIVATE Dbghelp.lib)

Thank you for your suggestion.