Open mascomen4 opened 2 years ago
CMake Output:
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library 1>libpng16_static.lib(png.obj) : warning LNK4217: locally defined symbol free imported in function png_info_init_3 1>libpng16_static.lib(pngmem.obj) : warning LNK4049: locally defined symbol free imported 1>zlibstatic.lib(zutil.obj) : warning LNK4049: locally defined symbol free imported 1>jpeg.lib(jmemnobs.obj) : warning LNK4049: locally defined symbol free imported 1>libpng16_static.lib(png.obj) : warning LNK4217: locally defined symbol fclose imported in function png_image_free_function 1>libpng16_static.lib(pngread.obj) : warning LNK4217: locally defined symbol fclose imported in function png_read_end 1>libpng16_static.lib(pngwrite.obj) : warning LNK4217: locally defined symbol fclose imported in function png_write_info 1>libpng16_static.lib(png.obj) : warning LNK4217: locally defined symbol frexp imported in function png_ascii_from_fp 1>libpng16_static.lib(png.obj) : warning LNK4217: locally defined symbol modf imported in function png_ascii_from_fp 1>libpng16_static.lib(pngread.obj) : warning LNK4217: locally defined symbol _errno imported in function png_image_begin_read_from_file 1>libpng16_static.lib(pngwrite.obj) : warning LNK4049: locally defined symbol _errno imported 1>libpng16_static.lib(pngread.obj) : warning LNK4217: locally defined symbol fopen imported in function png_image_begin_read_from_file 1>libpng16_static.lib(pngwrite.obj) : warning LNK4049: locally defined symbol fopen imported 1>libpng16_static.lib(pngwrite.obj) : warning LNK4217: locally defined symbol fflush imported in function png_image_write_to_file 1>libpng16_static.lib(pngwio.obj) : warning LNK4049: locally defined symbol fflush imported 1>libpng16_static.lib(pngwrite.obj) : warning LNK4217: locally defined symbol _gmtime64 imported in function png_convert_from_time_t 1>libpng16_static.lib(pngerror.obj) : warning LNK4217: locally defined symbol abort imported in function png_safe_error 1>libpng16_static.lib(pngerror.obj) : warning LNK4217: locally defined symbol acrt_iob_func imported in function png_chunk_error 1>jpeg.lib(jerror.obj) : warning LNK4049: locally defined symbol acrt_iob_func imported 1>libpng16_static.lib(pngerror.obj) : warning LNK4217: locally defined symbol stdio_common_vfprintf imported in function fprintf 1>jpeg.lib(jerror.obj) : warning LNK4049: locally defined symbol stdio_common_vfprintf imported 1>libpng16_static.lib(pngmem.obj) : warning LNK4217: locally defined symbol malloc imported in function png_calloc 1>zlibstatic.lib(zutil.obj) : warning LNK4049: locally defined symbol malloc imported 1>jpeg.lib(jmemnobs.obj) : warning LNK4049: locally defined symbol malloc imported 1>libpng16_static.lib(pngrio.obj) : warning LNK4217: locally defined symbol fread imported in function png_default_read_data 1>jpeg.lib(jdatasrc.obj) : warning LNK4049: locally defined symbol fread imported 1>libpng16_static.lib(pngwio.obj) : warning LNK4217: locally defined symbol fwrite imported in function png_default_write_data 1>jpeg.lib(jerror.obj) : warning LNK4217: locally defined symbol exit imported in function error_exit 1>jpeg.lib(jerror.obj) : warning LNK4217: locally defined symbol stdio_common_vsprintf imported in function sprintf 1>jpeg.lib(jmemmgr.obj) : warning LNK4217: locally defined symbol getenv imported in function jinit_memory_mgr 1>libpng16_static.lib(pngread.obj) : error LNK2019: unresolved external symbol __imp_strerror referenced in function png_image_begin_read_from_file 1>libpng16_static.lib(pngwrite.obj) : error LNK2001: unresolved external symbol imp_strerror 1>libpng16_static.lib(pngwrite.obj) : error LNK2019: unresolved external symbol imp_ferror referenced in function png_image_write_to_file 1>libpng16_static.lib(pngwrite.obj) : error LNK2019: unresolved external symbol imp_remove referenced in function png_image_write_to_file 1>libpng16_static.lib(pngget.obj) : error LNK2019: unresolved external symbol imp_atof referenced in function png_get_sCAL 1>jpeg.lib(jmemmgr.obj) : error LNK2019: unresolved external symbol _impstdio_common_vsscanf referenced in function sscanf 1>g2o.lib(property.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(optimization_algorithm_with_hessian.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(robust_kernel_factory.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(hyper_graph_action.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(cache.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(estimate_propagator.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(optimization_algorithm.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(parameter_container.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4 1>g2o.lib(jacobian_workspace.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(factory.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(string_tools.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(optimization_algorithm_levenberg.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(optimization_algorithm_gauss_newton.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(robust_kernel_impl.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(batch_stats.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4 1>g2o.lib(types_six_dof_expmap.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(types_seven_dof_expmap.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(sparse_optimizer.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(timeutil.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>DBoW2.lib(Timestamp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4 1>g2o.lib(hyper_graph.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(optimizable_graph.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(types_sba.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>DBoW2.lib(BowVector.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>DBoW2.lib(FeatureVector.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>DBoW2.lib(FORB.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>DBoW2.lib(Random.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 1>g2o.lib(property.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 1>g2o.lib(optimization_algorithm_with_hessian.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 1>g2o.lib(robust_kernel_factory.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 1>g2o.lib(string_tools.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 1>g2o.lib(hyper_graph_action.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 1>g2o.lib(cache.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 1>g2o.lib(optimization_algorithm.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 1>g2o.lib(robust_kernel_impl.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 1>g2o.lib(batch_stats.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 1>g2o.lib(parameter_container.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 1>g2o.lib(factory.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 1>g2o.lib(sparse_optimizer.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 1>g2o.lib(timeutil.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 1>g2o.lib(optimization_algorithm_levenberg.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 1>g2o.lib(optimization_algorithm_gauss_newton.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 1>g2o.lib(optimizable_graph.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 1>g2o.lib(types_sba.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 1>g2o.lib(types_six_dof_expmap.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 1>g2o.lib(types_seven_dof_expmap.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 1>DBoW2.lib(BowVector.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 1>DBoW2.lib(FeatureVector.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 1>DBoW2.lib(FORB.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 1>DBoW2.lib(Timestamp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 1>C:\Users\ivan\Source\Repos\ORB-SLAM3forWindows\Examples\Monocular-Inertial\Release\mono_inertial_euroc.exe : fatal error LNK1120: 7 unresolved externals ========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
I also having a similar issue while trying to build Pangolin according to the instructions.
11>libpng16_static.lib(pngread.obj) : error LNK2019: unresolved external symbol imp_strerror referenced in function png_image_begin_read_from_file 11>libpng16_static.lib(pngwrite.obj) : error LNK2001: unresolved external symbol imp_strerror 11>libpng16_static.lib(pngwrite.obj) : error LNK2019: unresolved external symbol imp_ferror referenced in function png_image_write_to_file 11>libpng16_static.lib(pngwrite.obj) : error LNK2019: unresolved external symbol imp_remove referenced in function png_image_write_to_file 11>libpng16_static.lib(pngget.obj) : error LNK2019: unresolved external symbol imp_atof referenced in function png_get_sCAL 11>jpeg.lib(jmemmgr.obj) : error LNK2019: unresolved external symbol imp___stdio_common_vsscanf referenced in function sscanf 11>D:\dev\extras\ORB-SLAM3forWindows\Thirdparty\Pangolin\build\examples\SimpleVideo\Release\SimpleVideo.exe : fatal error LNK1120: 5 unresolved externals 11>Done building project "SimpleVideo.vcxproj" -- FAILED.
etc
I'm also getting these errors and similar 32 warnings as you mentioned above. Did anyone found the solution?
I also having a similar issue while trying to build Pangolin according to the instructions.
11>libpng16_static.lib(pngread.obj) : error LNK2019: unresolved external symbol imp_strerror referenced in function png_image_begin_read_from_file 11>libpng16_static.lib(pngwrite.obj) : error LNK2001: unresolved external symbol imp_strerror 11>libpng16_static.lib(pngwrite.obj) : error LNK2019: unresolved external symbol imp_ferror referenced in function png_image_write_to_file 11>libpng16_static.lib(pngwrite.obj) : error LNK2019: unresolved external symbol imp_remove referenced in function png_image_write_to_file 11>libpng16_static.lib(pngget.obj) : error LNK2019: unresolved external symbol imp_atof referenced in function png_get_sCAL 11>jpeg.lib(jmemmgr.obj) : error LNK2019: unresolved external symbol imp___stdio_common_vsscanf referenced in function sscanf 11>D:\dev\extras\ORB-SLAM3forWindows\Thirdparty\Pangolin\build\examples\SimpleVideo\Release\SimpleVideo.exe : fatal error LNK1120: 5 unresolved externals 11>Done building project "SimpleVideo.vcxproj" -- FAILED.
etc
Hello! It's a problem of a linker. It's been a while now since I've successfully built Pangolin and ORB-SLAM3, but as far as I remember you have to be really careful and make sure that every library is built "static", not "dll". This link might be useful: https://stackoverflow.com/questions/5159353/how-can-i-get-rid-of-the-imp-prefix-in-the-linker-in-vc
But the problem I'm facing is during building Pangolin, it shows all the 12 examples are showing me failed and it's target extension and configuration type are set as .exe application, so do I need to build it in static .lib only?
But the problem I'm facing is during building Pangolin, it shows all the 12 examples are showing me failed and it's target extension and configuration type are set as .exe application, so do I need to build it in static .lib only?
Yes, you do. After you fix it, you might have the other issue, related to this https://github.com/stevenlovegrove/Pangolin/issues/609#issuecomment-645653656
If this doesn't work, it's better to install Pangolin from source following official documentation: https://github.com/stevenlovegrove/Pangolin#on-windows
If your employer doesn't ask you to build ORB-SLAM3 on Windows, I strongly suggest moving to Ubuntu. Even if they ask you to build on Windows, ask them why, and make sure there's really no other possibility to use Ubuntu. Believe me, that's a lot of pain building on Windows something which was not designed to. You'll have much more errors after you resolve this one :)
Thanks @mascomen4, with changing HelloPangolin and all other projects to .lib static library, there's no any error but now when I'm building ORB_SLAM3, it is showing me the same all imp(function name) error. so I feel it has something to do with only when we creating .exe application file. Bdw I also included add_definitions(-DLIBPNG_STATIC) add_definitions(-DLIBJPEG_STATIC) in CMakeLists.txt as mentioned in here, but I guess it's not helpful to resolve this error.
Hello! I'm trying to build mono_inertial_euroc, but I get the following error: I'm using Windows 10 with VirtualBox.
Error LNK2019 unresolved external symbol imp_strerror referenced in function png_image_begin_read_from_file mono_inertial_euroc C:\Users\ivan\Source\Repos\ORB-SLAM3forWindows\build\libpng16_static.lib(pngread.obj) 1
Error LNK2001 unresolved external symbol imp_strerror mono_inertial_euroc C:\Users\ivan\Source\Repos\ORB-SLAM3forWindows\build\libpng16_static.lib(pngwrite.obj) 1
Error LNK2019 unresolved external symbol imp_ferror referenced in function png_image_write_to_file mono_inertial_euroc C:\Users\ivan\Source\Repos\ORB-SLAM3forWindows\build\libpng16_static.lib(pngwrite.obj) 1
Error LNK2019 unresolved external symbol imp_remove referenced in function png_image_write_to_file mono_inertial_euroc C:\Users\ivan\Source\Repos\ORB-SLAM3forWindows\build\libpng16_static.lib(pngwrite.obj) 1
Error LNK2019 unresolved external symbol imp_atof referenced in function png_get_sCAL mono_inertial_euroc C:\Users\ivan\Source\Repos\ORB-SLAM3forWindows\build\libpng16_static.lib(pngget.obj) 1
Error LNK2019 unresolved external symbol _impstdio_common_vsscanf referenced in function sscanf mono_inertial_euroc C:\Users\ivan\Source\Repos\ORB-SLAM3forWindows\build\jpeg.lib(jmemmgr.obj) 1
Error LNK2001 unresolved external symbol CxxFrameHandler4 mono_inertial_euroc C:\Users\ivan\Source\Repos\ORB-SLAM3forWindows\build\g2o.lib(property.obj) 1
Error LNK2001 unresolved external symbol CxxFrameHandler4 mono_inertial_euroc C:\Users\ivan\Source\Repos\ORB-SLAM3forWindows\build\g2o.lib(optimization_algorithm_with_hessian.obj) 1
Error LNK2001 unresolved external symbol __CxxFrameHandler4 mono_inertial_euroc C:\Users\ivan\Source\Repos\ORB-SLAM3forWindows\build\g2o.lib(robust_kernel_factory.obj) 1