mapillary / OpenSfM

Open source Structure-from-Motion pipeline
https://www.opensfm.org/
BSD 2-Clause "Simplified" License
3.3k stars 848 forks source link

Build fail Windows 10 x64 Visual Studio 2019 #441

Open selau642 opened 5 years ago

selau642 commented 5 years ago

I installed Ceres[SparseSuite], OpenGV(import pyopengv working), SparseSuite from VCPKG, package manager. Subsequently I setup the CmakeSettings.json file in VS2019 to point to various libraries like AMD_INCLUDE_DIR etc...to SparseSuite folder. This is because I don't know how to setup the paths when running python setup.py so I tried using VS2019 internal system to build OpenSfM.

Despite that, when I build, I received the following message: The error message seems to be split into three parts:

  1. vlfeat
  2. akaze
  3. ceres-solver (not sure if when I install using VS2019, will it enable -fPIC flag?)

Should I post the CMakeError.log and CmakeOut.log files?

Can someone help me please?

[1/56] C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1421~1.277\bin\HostX64\x64\cl.exe /nologo -DCERES_GFLAGS_NAMESPACE=google -DVL_DISABLE_AVX -IC:\Users\Hyperion\Anaconda3\include -ID:\vcpkg\installed\x64-windows\include -ID:\vcpkg\installed\x64-windows\include\opencv -I......\third_party\akaze\lib -I......\third_party\vlfeat -I....... -I......\third_party\gtest /DWIN32 /D_WINDOWS /W3 -fPIC -fvisibility=hidden -openmp /MDd /ZI /Ob0 /Od /RTC1 /JMC /showIncludes /FoCMakeFiles\vl.dir\third_party\vlfeat\vl\array.c.obj /FdCMakeFiles\vl.dir\vl.pdb /FS -c ......\third_party\vlfeat\vl\array.c FAILED: CMakeFiles/vl.dir/third_party/vlfeat/vl/array.c.obj C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1421~1.277\bin\HostX64\x64\cl.exe /nologo -DCERES_GFLAGS_NAMESPACE=google -DVL_DISABLE_AVX -IC:\Users\Hyperion\Anaconda3\include -ID:\vcpkg\installed\x64-windows\include -ID:\vcpkg\installed\x64-windows\include\opencv -I......\third_party\akaze\lib -I......\third_party\vlfeat -I....... -I......\third_party\gtest /DWIN32 /D_WINDOWS /W3 -fPIC -fvisibility=hidden -openmp /MDd /ZI /Ob0 /Od /RTC1 /JMC /showIncludes /FoCMakeFiles\vl.dir\third_party\vlfeat\vl\array.c.obj /FdCMakeFiles\vl.dir\vl.pdb /FS -c ......\third_party\vlfeat\vl\array.c D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-fPIC' D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-fvisibility=hidden' D:\OpenSfM\opensfm\src\third_party\vlfeat\vl\array.c(24): error C2491: 'vl_array_get_num_elements': definition of dllimport function not allowed D:\OpenSfM\opensfm\src\third_party\vlfeat\vl\array.c(53): error C2491: 'vl_array_init': definition of dllimport function not allowed D:\OpenSfM\opensfm\src\third_party\vlfeat\vl\array.c(78): error C2491: 'vl_array_init_envelope': definition of dllimport function not allowed D:\OpenSfM\opensfm\src\third_party\vlfeat\vl\array.c(98): error C2491: 'vl_array_init_matrix': definition of dllimport function not allowed D:\OpenSfM\opensfm\src\third_party\vlfeat\vl\array.c(114): error C2491: 'vl_array_init_matrix_envelope': definition of dllimport function not allowed D:\OpenSfM\opensfm\src\third_party\vlfeat\vl\array.c(125): error C2491: 'vl_array_dealloc': definition of dllimport function not allowed D:\OpenSfM\opensfm\src\third_party\vlfeat\vl\array.c(150): error C2491: 'vl_array_new': definition of dllimport function not allowed D:\OpenSfM\opensfm\src\third_party\vlfeat\vl\array.c(163): error C2491: 'vl_array_new_matrix': definition of dllimport function not allowed D:\OpenSfM\opensfm\src\third_party\vlfeat\vl\array.c(178): error C2491: 'vl_array_new_envelope': definition of dllimport function not allowed D:\OpenSfM\opensfm\src\third_party\vlfeat\vl\array.c(192): error C2491: 'vl_array_new_matrix_envelope': definition of dllimport function not allowed D:\OpenSfM\opensfm\src\third_party\vlfeat\vl\array.c(203): error C2491: 'vl_array_delete': definition of dllimport function not allowed [2/56] C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1421~1.277\bin\HostX64\x64\cl.exe /nologo -DCERES_GFLAGS_NAMESPACE=google -DVL_DISABLE_AVX -IC:\Users\Hyperion\Anaconda3\include -ID:\vcpkg\installed\x64-windows\include -ID:\vcpkg\installed\x64-windows\include\opencv -I......\third_party\akaze\lib -I......\third_party\vlfeat -I....... -I......\third_party\gtest /DWIN32 /D_WINDOWS /W3 -fPIC -fvisibility=hidden -openmp /MDd /ZI /Ob0 /Od /RTC1 /JMC /showIncludes /FoCMakeFiles\vl.dir\third_party\vlfeat\vl\dsift.c.obj /FdCMakeFiles\vl.dir\vl.pdb /FS -c ......\third_party\vlfeat\vl\dsift.c FAILED: CMakeFiles/vl.dir/third_party/vlfeat/vl/dsift.c.obj C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1421~1.277\bin\HostX64\x64\cl.exe /nologo -DCERES_GFLAGS_NAMESPACE=google -DVL_DISABLE_AVX -IC:\Users\Hyperion\Anaconda3\include -ID:\vcpkg\installed\x64-windows\include -ID:\vcpkg\installed\x64-windows\include\opencv -I......\third_party\akaze\lib -I......\third_party\vlfeat -I....... -I......\third_party\gtest /DWIN32 /D_WINDOWS /W3 -fPIC -fvisibility=hidden -openmp /MDd /ZI /Ob0 /Od /RTC1 /JMC /showIncludes /FoCMakeFiles\vl.dir\third_party\vlfeat\vl\dsift.c.obj /FdCMakeFiles\vl.dir\vl.pdb /FS -c ......\third_party\vlfeat\vl\dsift.c D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-fPIC' D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-fvisibility=hidden' C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_math.h(276): warning C4005: 'isnan': macro redefinition D:\OpenSfM\opensfm\src\third_party\vlfeat\vl\host.h(316): note: see previous definition of 'isnan' C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\stdio.h(1933): warning C4005: 'snprintf': macro redefinition D:\OpenSfM\opensfm\src\third_party\vlfeat\vl\host.h(315): note: see previous definition of 'snprintf' C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\stdio.h(1935): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration [3/56] C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1421~1.277\bin\HostX64\x64\cl.exe /nologo -DCERES_GFLAGS_NAMESPACE=google -DVL_DISABLE_AVX -IC:\Users\Hyperion\Anaconda3\include -ID:\vcpkg\installed\x64-windows\include -ID:\vcpkg\installed\x64-windows\include\opencv -I......\third_party\akaze\lib -I......\third_party\vlfeat -I....... -I......\third_party\gtest /DWIN32 /D_WINDOWS /W3 -fPIC -fvisibility=hidden -openmp /MDd /ZI /Ob0 /Od /RTC1 /JMC /showIncludes /FoCMakeFiles\vl.dir\third_party\vlfeat\vl\aib.c.obj /FdCMakeFiles\vl.dir\vl.pdb /FS -c ......\third_party\vlfeat\vl\aib.c FAILED: CMakeFiles/vl.dir/third_party/vlfeat/vl/aib.c.obj C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1421~1.277\bin\HostX64\x64\cl.exe /nologo -DCERES_GFLAGS_NAMESPACE=google -DVL_DISABLE_AVX -IC:\Users\Hyperion\Anaconda3\include -ID:\vcpkg\installed\x64-windows\include -ID:\vcpkg\installed\x64-windows\include\opencv -I......\third_party\akaze\lib -I......\third_party\vlfeat -I....... -I......\third_party\gtest /DWIN32 /D_WINDOWS /W3 -fPIC -fvisibility=hidden -openmp /MDd /ZI /Ob0 /Od /RTC1 /JMC /showIncludes /FoCMakeFiles\vl.dir\third_party\vlfeat\vl\aib.c.obj /FdCMakeFiles\vl.dir\vl.pdb /FS -c ......\third_party\vlfeat\vl\aib.c D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-fPIC' D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-fvisibility=hidden' C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_math.h(276): warning C4005: 'isnan': macro redefinition D:\OpenSfM\opensfm\src\third_party\vlfeat\vl\host.h(316): note: see previous definition of 'isnan' C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\stdio.h(1933): warning C4005: 'snprintf': macro redefinition D:\OpenSfM\opensfm\src\third_party\vlfeat\vl\host.h(315): note: see previous definition of 'snprintf' C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\stdio.h(1935): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration [4/56] C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1421~1.277\bin\HostX64\x64\cl.exe /nologo /TP -DCERES_GFLAGS_NAMESPACE=google -DVL_DISABLE_AVX -IC:\Users\Hyperion\Anaconda3\include -I......\third_party\akaze\lib -I......\third_party\vlfeat -I....... -I......\third_party\gtest -ID:\vcpkg\installed\x64-windows\include -ID:\vcpkg\installed\x64-windows\include\opencv /DWIN32 /D_WINDOWS /W3 /GR /EHsc -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -openmp /MDd /ZI /Ob0 /Od /RTC1 /JMC /showIncludes /FoCMakeFiles\akaze.dir\third_party\akaze\lib\utils.cpp.obj /FdCMakeFiles\akaze.dir\akaze.pdb /FS -c ......\third_party\akaze\lib\utils.cpp D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-fPIC' D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-fvisibility=hidden' D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-fvisibility-inlines-hidden' D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-std=c++11' D:\OpenSfM\opensfm\src\third_party\akaze\lib\utils.cpp(89): warning C4244: '=': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\utils.cpp(90): warning C4244: 'argument': conversion from 'double' to 'int', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\utils.cpp(91): warning C4244: 'argument': conversion from 'double' to 'int', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\utils.cpp(178): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\utils.cpp(253): warning C4244: '=': conversion from 'const int' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\utils.cpp(254): warning C4244: '=': conversion from 'const int' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\utils.cpp(255): warning C4244: '=': conversion from 'const int' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\utils.cpp(256): warning C4244: '=': conversion from 'const int' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\utils.cpp(297): warning C4244: '=': conversion from 'const int' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\utils.cpp(298): warning C4244: '=': conversion from 'const int' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\utils.cpp(299): warning C4244: '=': conversion from 'const int' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\utils.cpp(300): warning C4244: '=': conversion from 'const int' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\utils.cpp(358): warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\stdio.h(2263): note: see declaration of 'sscanf' D:\OpenSfM\opensfm\src\third_party\akaze\lib\utils.cpp(361): warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\stdio.h(2263): note: see declaration of 'sscanf' D:\OpenSfM\opensfm\src\third_party\akaze\lib\utils.cpp(364): warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\stdio.h(2263): note: see declaration of 'sscanf' [5/56] C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1421~1.277\bin\HostX64\x64\cl.exe /nologo /TP -DCERES_GFLAGS_NAMESPACE=google -DVL_DISABLE_AVX -IC:\Users\Hyperion\Anaconda3\include -I......\third_party\akaze\lib -I......\third_party\vlfeat -I....... -I......\third_party\gtest -ID:\vcpkg\installed\x64-windows\include -ID:\vcpkg\installed\x64-windows\include\opencv /DWIN32 /D_WINDOWS /W3 /GR /EHsc -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -openmp /MDd /ZI /Ob0 /Od /RTC1 /JMC /showIncludes /FoCMakeFiles\akaze.dir\third_party\akaze\lib\nldiffusion_functions.cpp.obj /FdCMakeFiles\akaze.dir\akaze.pdb /FS -c ......\third_party\akaze\lib\nldiffusion_functions.cpp D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-fPIC' D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-fvisibility=hidden' D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-fvisibility-inlines-hidden' D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-std=c++11' D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(32): warning C4244: '=': conversion from 'double' to 'size_t', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(44): warning C4267: 'argument': conversion from 'size_t' to '_Tp', possible loss of data with [ _Tp=int ] D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(50): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(57): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(73): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(79): warning C4244: '=': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(87): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(94): warning C4244: '=': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(106): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(112): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(113): warning C4244: '=': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(172): warning C4244: '=': conversion from 'float' to 'size_t', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(188): warning C4244: '=': conversion from 'float' to 'size_t', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(191): warning C4305: '=': truncation from 'double' to 'float' D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(233): warning C4244: '=': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(248): warning C4244: '=': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(253): warning C4244: '=': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(258): warning C4244: '=': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(271): warning C4244: '=': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(276): warning C4244: '=': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(281): warning C4244: '=': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(297): warning C4244: '=': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(302): warning C4244: '=': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(326): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(326): warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(330): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(339): warning C4305: 'initializing': truncation from 'double' to 'float' D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(340): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data D:\OpenSfM\opensfm\src\third_party\akaze\lib\nldiffusion_functions.cpp(344): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [6/56] C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1421~1.277\bin\HostX64\x64\cl.exe /nologo /TP -DCERES_GFLAGS_NAMESPACE=google -DGFLAGS_IS_A_DLL=1 -DVL_DISABLE_AVX -IC:\Users\Hyperion\Anaconda3\include -ID:\vcpkg\installed\x64-windows\include\opencv -I......\third_party\akaze\lib -I......\third_party\vlfeat -I....... -I......\third_party\gtest -ID:\vcpkg\installed\x64-windows\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -openmp /MDd /ZI /Ob0 /Od /RTC1 /JMC /showIncludes /FoCMakeFiles\bundle.dir\bundle\src\bundle_adjuster.cc.obj /FdCMakeFiles\bundle.dir\bundle.pdb /FS -c ......\bundle\src\bundle_adjuster.cc FAILED: CMakeFiles/bundle.dir/bundle/src/bundle_adjuster.cc.obj C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1421~1.277\bin\HostX64\x64\cl.exe /nologo /TP -DCERES_GFLAGS_NAMESPACE=google -DGFLAGS_IS_A_DLL=1 -DVL_DISABLE_AVX -IC:\Users\Hyperion\Anaconda3\include -ID:\vcpkg\installed\x64-windows\include\opencv -I......\third_party\akaze\lib -I......\third_party\vlfeat -I....... -I......\third_party\gtest -ID:\vcpkg\installed\x64-windows\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -openmp /MDd /ZI /Ob0 /Od /RTC1 /JMC /showIncludes /FoCMakeFiles\bundle.dir\bundle\src\bundle_adjuster.cc.obj /FdCMakeFiles\bundle.dir\bundle.pdb /FS -c ......\bundle\src\bundle_adjuster.cc D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-fPIC' D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-fvisibility=hidden' D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-fvisibility-inlines-hidden' D:\OpenSfM\opensfm\src\cl : Command line warning D9002: ignoring unknown option '-std=c++11' D:\vcpkg\installed\x64-windows\include\ceres\gradientproblem.h(108): warning C4251: 'ceres::GradientProblem::function': class 'ceres::internal::scoped_ptr' needs to have dll-interface to be used by clients of class 'ceres::GradientProblem' D:\vcpkg\installed\x64-windows\include\ceres\gradient_problem.h(108): note: see declaration of 'ceres::internal::scoped_ptr' D:\vcpkg\installed\x64-windows\include\ceres\gradientproblem.h(109): warning C4251: 'ceres::GradientProblem::parameterization': class 'ceres::internal::scoped_ptr' needs to have dll-interface to be used by clients of class 'ceres::GradientProblem' D:\vcpkg\installed\x64-windows\include\ceres\gradient_problem.h(109): note: see declaration of 'ceres::internal::scoped_ptr' D:\vcpkg\installed\x64-windows\include\ceres\gradientproblem.h(110): warning C4251: 'ceres::GradientProblem::scratch': class 'ceres::internal::scoped_array' needs to have dll-interface to be used by clients of class 'ceres::GradientProblem' D:\vcpkg\installed\x64-windows\include\ceres\gradient_problem.h(110): note: see declaration of 'ceres::internal::scoped_array' D:\OpenSfM\opensfm\src\bundle\src\projection_errors.h(203): error C2065: 'M_PI': undeclared identifier D:\OpenSfM\opensfm\src\bundle\src\projection_errors.h(204): error C2065: 'M_PI': undeclared identifier ninja: build stopped: subcommand failed.

s-wtnb commented 4 years ago

The following changes were required to build on Windows(win10 + VS2017).

host.h L315- change

    #  define snprintf _snprintf
    #  define isnan _isnan
#if _MSC_VER < 1700 
    #  define snprintf _snprintf
    #  define isnan _isnan
#endif

absolute_motion_terms.h L7- add

#if _MSC_VER < 1700 
    #define _USE_MATH_DEFINES
    #include <math.h>
#endif

The following are the changes in the properties of the VL project. Change .lib to .dll. Add "VL_BUILDDLL" and "__SSE2_\" to the preprocessor definition.