OpenCV on Mac OS X 10.8 Mountain Lion
I have used OpenCV with Qt Creator on Windows, but now wanted to use it on Mac OS X too. So I installed 2.4.2, used CMake to make and build (install) the whole, which went without any problems. But, when I add #include <cv.hpp> to one of my files, I get the following error 5 times:
/usr/local/include/opencv2/flann/params.h:87: error: explicit instantiation of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]' but no definition available
The code around the error is this:
inline void print_params(const IndexParams& params)
{
IndexParams::const_iterator it;
for(it=params.begin(); it!=params.end(); ++it) {
std::cout << it->first << " : " << it->second << std::endl;
}
}
with the error occurring in the line with std::cout << it->first ...
I can't figure out why this is happening. Any help is greatly appreciated!
I don't know what IndexParams means, but try to take it->first in a separate line and return it's value and try to print it's fields firstly then if every thing is ok, So "cout << it->first" is illegal.
Well, this is code from OpenCV itself, which worked in Mac OS X 10.7. It works as it is on Windows too, so I don't think there's really anything wrong with it. Also, the error complains about the explicit instantiation of std::basic_ostream(etc.), which would be cout I guess. The file has an #include <iostream>, so it should be able to use std::cout.