Static build with PCL and OpenCV in Visual Studio 2010 -
Static build with PCL and OpenCV in Visual Studio 2010 -
i have running project in visual studio 2010 using opencv 2.49 , point cloud library 1.6 . trying create standalone executable don´t need install opencv , pcl in other computers create run. opencv , pcl installed using precompiled binaries, , pcl included boost (1.49) , vtk (5.8) libraries, among others.
for making static build, changed runtime library in vs /mt. then, boost static libraries missing, installed boost 1 time again (version 1.56, believe needed libs 's').
then had errors like:
1>msvcrt.lib(msvcr100.dll) : error lnk2005: _malloc defined in libcmt.lib(malloc.obj) so added msvcrt.lib, msvcprt.lib section "ignore specific defaul libraries".
now have errors like:
1>vtkcommon.lib(vtkvoidarray.obj) : error lnk2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<(void const *)" (__imp_??6?$basic_ostream@du?$char_traits@d@std@@@std@@qaeaav01@pbx@z) 1>vtkcommon.lib(vtkvariantarray.obj) : error lnk2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<(void const *)" (__imp_??6?$basic_ostream@du?$char_traits@d@std@@@std@@qaeaav01@pbx@z) 1>vtkcommon.lib(vtktimerlog.obj) : error lnk2001: unresolved external symbol __imp__strncpy 1>vtkcommon.lib(vtkmath.obj) : error lnk2001: unresolved external symbol __imp__modf 1>vtksys.lib(systemtools.obj) : error lnk2001: unresolved external symbol __imp___utime64 1>oldnames.lib(unlink.obi) : error lnk2001: unresolved external symbol __imp__unlink the vtk library included same way in non-static release build. and, if understood correctly, .lib extension static libray.
what doing wrong?
edit: tried using cmake, getting same kind of errors (there lot more):
2>vtksys.lib(systemtools.obj) : error lnk2019: unresolved external symbol __imp___time64 referenced in function _time 2>vtkcommon.lib(vtkvariant.obj) : error lnk2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_istream<char,struct std::char_traits<char> > & __thiscall std::basic_istream<char,struct std::char_traits<char> >::operator>>(short &)" (__imp_??5?$basic_istream@du?$char_traits@d@std@@@std@@qaeaav01@aaf@z) referenced in function "short __cdecl vtkvariantstringtonumeric<short>(class vtkstdstring,bool *,short *)" (??$vtkvariantstringtonumeric@f@@yafvvtkstdstring@@pa_npaf@z) this cmakelist.txt:
cmake_minimum_required(version 2.8 fatal_error) project(3dvisualizercm) set(build_shared_libs off) set(cmake_exe_linker_flags "/nodefaultlib:msvcrt.lib /nodefaultlib:msvcprt.lib") find_package(pcl 1.4 required) find_package(opencv required) include_directories(${pcl_include_dirs} ) link_directories(${pcl_library_dirs} ) add_definitions(${pcl_definitions} ) add_executable (3d_v4 3d_v4.cpp c3dvisualizer.cpp c3dvisualizermultiple.cpp c3dvisualizersingle.cpp ccameraparameters.cpp cimagetrack.cpp cimg.cpp cimgmultiple.cpp cimgsingle.cpp helpers.cpp ) target_link_libraries (3d_v4 ${pcl_libraries} ${opencv_libs})
the precompiled vtk libraries using pcl must have been compiled using /md flag (multithreaded dll) in visual studio. need recompile them using /mt flag (multithreaded static link).
visual-studio-2010 build static-linking vtk point-cloud-library
Comments
Post a Comment