2.3.1b/2.3.2 release with clang support ? [flann include errors] (Bug #1432)
Description
On Mac OS X Lion, OpenCV 2.3.1 compiled with llvm-gcc (see ticket #1431) can not be used in a project compiled with clang because of two small errors in includes of flann. The same errors are present in svn trunk version (rev 6880).
I get the following errors :
/Users/mansencal/tools/include/opencv2/flann/lsh_index.h:89:81: error: no matching constructor for initialization of 'cvflann::LshIndexParams'
LshIndex(const Matrix<ElementType>& input_data, const IndexParams& params = LshIndexParams(),
^
/Users/mansencal/tools/include/opencv2/flann/lsh_index.h:59:5: note: candidate constructor not viable: requires 3 arguments, but 0 were provided
LshIndexParams(unsigned int table_number, unsigned int key_size, unsigned int multi_probe_level)
^
=> This error may be corrected by adding an empty constructor for LshIndexParams.
and
/Users/mansencal/tools/include/opencv2/flann/any.h:88:67: error: invalid operands to binary expression ('std::ostream' (aka 'basic_ostream<char>') and
'const cdiggins::anyimpl::empty_any')
virtual void print(std::ostream& out, void* const* src) { out << reinterpret_cast<T const>(*src); }
~ ^ ---------------~
/Users/mansencal/tools/include/opencv2/flann/any.h:136:44: note: in instantiation of member function 'cdiggins::anyimpl::big_any_policy<cdiggins::anyimpl::empty_any>::print'
requested here
static typename choose_policy<T>::type policy;
^
/Users/mansencal/tools/include/opencv2/flann/any.h:159:18: note: in instantiation of function template specialization
'cdiggins::anyimpl::get_policy<cdiggins::anyimpl::empty_any>' requested here
: policy(anyimpl::get_policy<anyimpl::empty_any>()), object(NULL)
=> This error may be corrected by adding a dummy function
std::ostream& operator <<(std::ostream& out, const empty_any&)
The attached patch solves these problems.
(It was generated form OpenCV2.3.1 but should be identical for svn trunk version).
It should probably be added to a 2.3.1b or 2.3.2 release.
Associated revisions
Clang compilation fixes, closes #1432
Merge pull request #1432 from SpecLad:unseq
History
Updated by Boris Mansencal over 13 years ago
FYI, it is Mac OS X 10.7.1, with clang --version giving :
Apple clang version 2.1 (tags/Apple/clang-136.7.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin11.1.0
Thread model: posix
Updated by Marius Muja over 13 years ago
Fixed in r6881.
- Status changed from Open to Done
- (deleted custom field) set to fixed
Updated by Andrey Kamaev almost 13 years ago
- Target version set to 2.4.0