Cannot Compile OpenCV 2.4.5 with VS 2013 RTM

后端 未结 3 1596
长发绾君心
长发绾君心 2021-01-06 02:12

Has anyone had any luck compiling openCV with VS 2013 RTM? I have tried and get a bunch of "min doesn\'t belong to namespace std" "max doesn\'t belong to name

相关标签:
3条回答
  • 2021-01-06 02:25

    Please see http://code.opencv.org/issues/3273 for more information on the internal compiler error issue.

    0 讨论(0)
  • 2021-01-06 02:34

    I've managed to compile OpenCV 2.4.6 on VS2013 RC, but initially it had the same errors as in question. I've opened VS solution and fixed all error in two steps:

    1) Replaced (Ctrl+H)

    #include \<string\> 
    

    to

    #include <algorithm>\n#include <string>
    

    in entire solution (be sure to enable RegExp in replace dialog)

    2) In "modules/opencv_features2d/Src/features2d_init.cpp" changed line 184 to:

    obj.info()->addParam(obj, "detector", (Ptr<Algorithm>&) obj.detector);
    

    (search for "GridAdaptedFeatureDetector" in this file for other OpenCV versions)

    0 讨论(0)
  • 2021-01-06 02:39

    For the first issue:

    http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx

    It is explicitly called out:

    • You must #include <algorithm> when calling std::min() or std::max().

    Before due to the internal implementation of the VC++ libraries <string> would pull in these functions.

    0 讨论(0)
提交回复
热议问题