mapillary / mapillary/OpenSfM

Can't build on MSVC 2019

Open
#848 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.8k
Forks
899
PR merge metrics
No merged PRs in 30d

Description

Installed VS 2019 and VS build tools 2017
Do all, that written on https://opensfm.org/docs/building.html for Windows
in cmake -G try "Visual Studio 15 2017 Win64" and "Visual Studio 16 2019"
OpenSFM current last from git main

vcpkg installed:

vcpkg install opencv4 ceres ceres[cxsparse,eigensparse,lapack,suitesparse,tools] lapack suitesparse --triplet x64-windows

cmake cmds:

cmake ../opensfm/src -DPYTHON_EXECUTABLE=C:\Users\Proger-1\AppData\Local\Programs\Python\Python38\python.exe -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 15 2017 Win64"
cmake --build . --config Release

Compiler error:

Создается библиотека C:/OSfM/build19/geometry/Release/pygeometry.lib и объект C:/OSfM/build19/geometry/Release/pygeometry.exp
geometry.lib(triangulation.obj) : error LNK2001: неразрешенный внешний символ "__declspec(dllimport) public: __cdecl ceres::CostFunction::CostFunction(void)" (_imp??0CostFunction@ceres@@QEAA@XZ). [C:\OSfM\build19\geometry\pygeometry.vcxproj]
geometry.lib(triangulation.obj) : error LNK2001: неразрешенный внешний символ "__declspec(dllimport) public: virtual __cdecl ceres::CostFunction::~CostFunction(void)" (_imp??1CostFunction@ceres@@UEAA@XZ). [C:\OSfM\build19\geometry\pygeometry.vcxproj]
geometry.lib(triangulation.obj) : error LNK2001: неразрешенный внешний символ "public: virtual __cdecl ceres::CostFunction::~CostFunction(void)" (??1CostFunction@ceres@@UEAA@XZ). [C:\OSfM\build19\geometry\pygeometry.vcxproj]
C:\OSfM\opensfm\pygeometry.cp38-win_amd64.pyd : fatal error LNK1120: неразрешенных внешних элементов: 3 [C:\OSfM\build19\geometry\pygeometry.vcxproj]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Windows build instructions and reproduce the reported CMake configuration using the Visual Studio 2019 generator and the x64-windows vcpkg triplet. Inspect the generated geometry/pygeometry.vcxproj target and its Ceres linkage around the reported triangulation.obj errors; done means cmake --build . --config Release completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.