Errors building OpenCV-2.4.6 with Visual Studio 2013
I am attempting to build OpenCV with VC12 and have encountered an error I can't figure out. Here is the error
opencv\modules\core\include\opencv2/core.hpp(1136): fatal error C1075: end of file found before the left brace '{' at '......\modules\features2d\src\features2d_init.cpp(182)' was matched
Snip from core.hpp
template<typename _Tp> void addParam(Algorithm& algo, const char* name,
Ptr<_Tp>& value, bool readOnly=false,
Ptr<_Tp> (Algorithm::*getter)()=0,
void (Algorithm::*setter)(const Ptr<_Tp>&)=0,//LINE 1136
const String& help=String());
Snip from features2d_init.cpp
CV_INIT_ALGORITHM(GridAdaptedFeatureDetector, "Feature2D.Grid",
obj.info()->addParam(obj, "detector", obj.detector);
obj.info()->addParam(obj, "maxTotalKeypoints", obj.maxTotalKeypoints);
obj.info()->addParam(obj, "gridRows", obj.gridRows);
obj.info()->addParam(obj, "gridCols", obj.gridCols));//LINE 182
And here is the macro definition from private.hpp
#define CV_INIT_ALGORITHM(classname, algname, memberinit) \
static ::cv::Algorithm* create##classname##_hidden() \
{ \
return new classname; \
} \
\
static ::cv::AlgorithmInfo& classname##_info() \
{ \
static ::cv::AlgorithmInfo classname##_info_var(algname, create##classname##_hidden); \
return classname##_info_var; \
} \
\
static ::cv::AlgorithmInfo& classname##_info_auto = classname##_info(); \
\
::cv::AlgorithmInfo* classname::info() const \
{ \
static volatile bool initialized = false; \
\
if( !initialized ) \
{ \
initialized = true; \
classname obj; \
memberinit; \
} \
return &classname##_info(); \
}
Any help is appreciated.
Hmm I know that vc10 is supported for VS2010 and vc11 for VS2013 but it seems that some building rules must have changed when switching to VS2013. However, you can still use vc11 or vc10 in VS2013 right? Why not do that to solve the problem?
I have the same issue as well. Seeing as VS2013 will shortly be widely adopted, we might a well figure out a solution now.
I have the same issue with VS2013. The error occurs with both OpenCV 2.4.6-stable and the git-master. The issue occurs in VS2013, but not in VS2012. How can we fix that for VS2013?