2.3.1b/2.3.2 release with clang support ? [flann include errors] (Bug #1432)


Added by Boris Mansencal over 13 years ago. Updated almost 13 years ago.


Status:Done Start date:
Priority:Blocker Due date:
Assignee:Marius Muja % Done:

0%

Category:flann
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

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.


OpenCV2.3.1c.patch - patch to be able to use opencv headers in project compiled by clang (437 Bytes) Boris Mansencal, 2011-10-18 04:56 pm


Associated revisions

Revision a73b509b
Added by Marius Muja over 13 years ago

Clang compilation fixes, closes #1432

Revision caf9fdbd
Added by Roman Donchenko over 11 years ago

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

Also available in: Atom PDF