Build error: ‘vector’ in namespace ‘std’ does not name a template type
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 899
- PR merge metrics
- No merged PRs in 30d
Description
Howdy folks!
When I clone the repo to my Ubuntu 18.04 machine and run "python3 setup.py build" i get the following output with errors:
Configuring for python 3.7...
-- A library with LAPACK API found.
-- Found AMD library: /usr/lib/x86_64-linux-gnu/libamd.so
-- Found AMD header in: /usr/include/suitesparse
-- Found CAMD library: /usr/lib/x86_64-linux-gnu/libcamd.so
-- Found CAMD header in: /usr/include/suitesparse
-- Found COLAMD library: /usr/lib/x86_64-linux-gnu/libcolamd.so
-- Found COLAMD header in: /usr/include/suitesparse
-- Found CCOLAMD library: /usr/lib/x86_64-linux-gnu/libccolamd.so
-- Found CCOLAMD header in: /usr/include/suitesparse
-- Found CHOLMOD library: /usr/lib/x86_64-linux-gnu/libcholmod.so
-- Found CHOLMOD header in: /usr/include/suitesparse
-- Found CXSPARSE library: /usr/lib/x86_64-linux-gnu/libcxsparse.so
-- Found SuiteSparseQR library: /usr/lib/x86_64-linux-gnu/libspqr.so
-- Found SuiteSparseQR header in: /usr/include/suitesparse
-- Found Intel Thread Building Blocks (TBB) library: /usr/lib/x86_64-linux-gnu/libtbb.so, assuming SuiteSparseQR was compiled with TBB.
-- Found Intel Thread Building Blocks (TBB) Malloc library: /usr/lib/x86_64-linux-gnu/libtbbmalloc.so
-- Found SuiteSparse_config library: /usr/lib/x86_64-linux-gnu/libsuitesparseconfig.so
-- Found SuiteSparse_config header in: /usr/include/suitesparse
-- Adding librt: /usr/lib/x86_64-linux-gnu/librt.so to SuiteSparse_config libraries (required on Linux & Unix [not OSX] if SuiteSparse is compiled with timing).
-- Did not find METIS library (optional SuiteSparse dependency)
-- No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
-- Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags
-- Detected gflags version: 2.2.1
-- Found OpenCV: /usr (found version "3.3.1")
-- Found OpenCV: /usr (found version "3.3.1") found components: core imgproc calib3d imgcodecs
-- pybind11 v2.2.4
-- Configuring done
-- Generating done
-- Build files have been written to: /media/taylor/feynman/Software/OpenSfM/cmake_build
Compiling extension...
[ 3%] Built target gtest
[ 8%] Built target akaze
[ 45%] Built target vl
[ 51%] Built target foundation
[ 53%] Built target test_main
Scanning dependencies of target geometry
[ 55%] Built target bundle
[ 59%] Built target features
[ 61%] Built target dense
[ 64%] Built target sfm
[ 65%] Building CXX object geometry/CMakeFiles/geometry.dir/src/camera.cc.o
[ 68%] Built target foundation_test
[ 69%] Building CXX object geometry/CMakeFiles/geometry.dir/src/essential.cc.o
[ 71%] Built target pybundle
[ 72%] Building CXX object geometry/CMakeFiles/geometry.dir/src/absolute_pose.cc.o
[ 74%] Built target pydense
[ 76%] Built target dense_test
[ 78%] Built target pyfeatures
[ 80%] Built target pysfm
[ 82%] Built target sfm_test
In file included from /media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/essential.cc:1:0:
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/../essential.h:99:6: error: ‘vector’ in namespace ‘std’ does not name a template type
std::vector<Eigen::Matrix<double, 3, 3>> EssentialFivePoints(IT begin, IT end) {
^~~~~~
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/../essential.h:164:6: error: ‘vector’ in namespace ‘std’ does not name a template type
std::vector<Eigen::Matrix<double, 3, 3>> EssentialNPoints(IT begin, IT end) {
^~~~~~
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/../essential.h:190:6: error: ‘vector’ in namespace ‘std’ does not name a template type
std::vector<Eigen::Matrix<double, 3, 3>> EssentialFivePoints(
^~~~~~
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/../essential.h:194:6: error: ‘vector’ in namespace ‘std’ does not name a template type
std::vector<Eigen::Matrix<double, 3, 3>> EssentialNPoints(
^~~~~~
In file included from /media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/absolute_pose.cc:1:0:
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/absolute_pose.h:15:6: error: ‘vector’ in namespace ‘std’ does not name a template type
std::vector<Eigen::Matrix<double, 3, 4>> AbsolutePoseThreePoints(IT begin, IT end) {
^~~~~~
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/absolute_pose.h: In function ‘Eigen::Matrix<double, 3, 4> AbsolutePoseNPoints(IT, IT)’:
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/absolute_pose.h:145:10: error: ‘vector’ is not a member of ‘std’
std::vector< std::pair<Eigen::Vector3d, Eigen::Vector3d> > current_points;
^~~~~~
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/absolute_pose.h:145:62: error: expected primary-expression before ‘>’ token
std::vector< std::pair<Eigen::Vector3d, Eigen::Vector3d> > current_points;
^
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/absolute_pose.h:145:64: error: ‘current_points’ was not declared in this scope
std::vector< std::pair<Eigen::Vector3d, Eigen::Vector3d> > current_points;
^~~~~~~~~~~~~~
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/absolute_pose.h: At global scope:
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/absolute_pose.h:174:6: error: ‘vector’ in namespace ‘std’ does not name a template type
std::vector<Eigen::Matrix<double, 3, 4>> AbsolutePoseThreePoints(
^~~~~~
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/absolute_pose.cc:19:6: error: ‘vector’ in namespace ‘std’ does not name a template type
std::vector<Eigen::Matrix<double, 3, 4>> AbsolutePoseThreePoints(
^~~~~~
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/absolute_pose.cc: In function ‘Eigen::Matrix<double, 3, 4> geometry::AbsolutePoseNPoints(const Eigen::Matrix<double, -1, 3>&, const Eigen::Matrix<double, -1, 3>&)’:
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/absolute_pose.cc:33:8: error: ‘vector’ is not a member of ‘std’
std::vector<std::pair<Eigen::Vector3d, Eigen::Vector3d>> samples(bearings.rows());
^~~~~~
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/absolute_pose.cc:33:57: error: expected primary-expression before ‘>’ token
std::vector<std::pair<Eigen::Vector3d, Eigen::Vector3d>> samples(bearings.rows());
^~
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/absolute_pose.cc:33:60: error: ‘samples’ was not declared in this scope
std::vector<std::pair<Eigen::Vector3d, Eigen::Vector3d>> samples(bearings.rows());
^~~~~~~
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/absolute_pose.cc: In function ‘Eigen::Vector3d geometry::AbsolutePoseNPointsKnownRotation(const Eigen::Matrix<double, -1, 3>&, const Eigen::Matrix<double, -1, 3>&)’:
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/absolute_pose.cc:44:8: error: ‘vector’ is not a member of ‘std’
std::vector<std::pair<Eigen::Vector3d, Eigen::Vector3d>> samples(bearings.rows());
^~~~~~
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/absolute_pose.cc:44:57: error: expected primary-expression before ‘>’ token
std::vector<std::pair<Eigen::Vector3d, Eigen::Vector3d>> samples(bearings.rows());
^~
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/absolute_pose.cc:44:60: error: ‘samples’ was not declared in this scope
std::vector<std::pair<Eigen::Vector3d, Eigen::Vector3d>> samples(bearings.rows());
^~~~~~~
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/essential.cc:154:6: error: ‘vector’ in namespace ‘std’ does not name a template type
std::vector<Eigen::Matrix<double, 3, 3>> EssentialFivePoints(
^~~~~~
/media/taylor/feynman/Software/OpenSfM/opensfm/src/geometry/src/essential.cc:168:6: error: ‘vector’ in namespace ‘std’ does not name a template type
std::vector<Eigen::Matrix<double, 3, 3>> EssentialNPoints(
^~~~~~
geometry/CMakeFiles/geometry.dir/build.make:104: recipe for target 'geometry/CMakeFiles/geometry.dir/src/absolute_pose.cc.o' failed
make[2]: *** [geometry/CMakeFiles/geometry.dir/src/absolute_pose.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
geometry/CMakeFiles/geometry.dir/build.make:78: recipe for target 'geometry/CMakeFiles/geometry.dir/src/essential.cc.o' failed
make[2]: *** [geometry/CMakeFiles/geometry.dir/src/essential.cc.o] Error 1
CMakeFiles/Makefile2:700: recipe for target 'geometry/CMakeFiles/geometry.dir/all' failed
make[1]: *** [geometry/CMakeFiles/geometry.dir/all] Error 2
Makefile:97: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
File "setup.py", line 49, in <module>
build_c_extension()
File "setup.py", line 45, in build_c_extension
subprocess.check_call(['make', '-j4'], cwd='cmake_build')
File "/home/taylor/miniconda3/lib/python3.7/subprocess.py", line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', '-j4']' returned non-zero exit status 2.
If I add
#include <vector>
to the top of the following files, the code compiles fully:
opensfm/src/geometry/absolute_pose.h
opensfm/src/geometry/camera.h
opensfm/src/geometry/essential.h
Thoughts?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with python3 setup.py build, then inspect opensfm/src/geometry/absolute_pose.h, camera.h, and essential.h, which are named in the report. Confirm that the geometry extension builds successfully without the reported std::vector errors and that the existing geometry tests still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100