Openmvg: Compilation error on Mint/Ubuntu 14.04

Created on 22 Aug 2016  Â·  5Comments  Â·  Source: openMVG/openMVG

Hi, I was trying to build openMVG on Mint/Ubuntu 14.04 platform but encountered some compilation errors, which seems to be related with gcc (4.7):

/usr/include/c++/4.7/bits/stl_tree.h:130:12: error: use of deleted function ‘constexpr std::pair<_T1, _T2>::pair(const std::pair<_T1, _T2>&) [with _T1 = const unsigned int; _T2 = std::unique_ptropenMVG::features::Regions; std::pair<_T1, _T2> = std::pair >]’

/usr/include/c++/4.7/bits/stl_pair.h:119:17: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = openMVG::features::Regions; _Dp = std::default_deleteopenMVG::features::Regions; std::unique_ptr<_Tp, _Dp> = std::unique_ptropenMVG::features::Regions]’
In file included from /usr/include/c++/4.7/memory:86:0,

/usr/include/c++/4.7/bits/unique_ptr.h:262:7: error: declared here

Thanks in advance!

build question

Most helpful comment

Ran into this problem myself with GCC 4.7. Only GCC >= 4.8 supports the fully range of c++11 features, and the move operations are quite messy. A number of alterations in regards to unique pointer handling need to be applied to OpenMVG to make it compatible.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53584

I think the posted issue is from the sfm_*_provider source files. The easiest solution is to just replace every unique_ptr with shared_ptr in those headers.

All 5 comments

Since unique_ptr is supported from GCC 4.4.7 I have no idea yet.

@rperrot any idea?

Just to make some investigations, could you give us more details :
1) Could you give us a more complete message about the compilation (I want to know where is the error, is it openMVG or openMVG's dependencies related ?)
2) Which branch did you used ?

@pmoulon First impression, maybe it's a STL related issue (c++11 is not fully supported on gcc4.7, maybe a const or a ref issue).

Ran into this problem myself with GCC 4.7. Only GCC >= 4.8 supports the fully range of c++11 features, and the move operations are quite messy. A number of alterations in regards to unique pointer handling need to be applied to OpenMVG to make it compatible.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53584

I think the posted issue is from the sfm_*_provider source files. The easiest solution is to just replace every unique_ptr with shared_ptr in those headers.

As said by @donlk:

Please update your GCC, some recent modification make OpenMVG require a GCC >=4.8
The build instruction where updated in the develop branch see here https://github.com/openMVG/openMVG/blob/develop/BUILD#L24

Thanks for the replies! Using GCC-4.8 solved the problem

Was this page helpful?
0 / 5 - 0 ratings