Ask Your Question

Alok's profile - activity

2013-03-31 23:24:39 -0500 commented question Compilation error (VS 2008, 64 bit, Windows 7)

Getting to the bottom of the issue, this compilation error happens with Microsoft-specific language extensions are "disabled". This is compiler flag "/Za". Using this option is normally good to ensure the code will compile across platforms (since Microsoft-specific extensions are not available outside of Windows), but somehow there is some issue with OpenCV code even though it is cross-platform.

2013-03-30 21:47:24 -0500 commented question Compilation error (VS 2008, 64 bit, Windows 7)

@berak, I am not using pre-compiled headers. The Visual Studio solution is generated using Cmake. After struggling with this a bit, I find that the code compiles correctly if I prepare VS project by hand. Something is wrong in the Cmake files. It is discovering OpenCV includes and libs by itself, but maybe not from the correct place.

2013-03-30 04:00:58 -0500 asked a question Compilation error (VS 2008, 64 bit, Windows 7)

Hi all,

I have successfully compiled OpenCV 2.4.4 for 64-bits using Visual Studio 2008 on Windows 7 x64.

When I create sample application now, I get compilation errors in one of the OpenCV header files:

\modules\core\include\opencv2/core/operations.hpp(1456) : error C2065: 'val' : undeclared identifier

The following is relevant piece of the code, where 'val' is claimed to be undeclared.

template<> inline Vec<float, 3> Vec<float, 3>::cross(const Vec<float, 3>& v) const
{
    return Vec<float,3>(val[1]*v.val[2] - val[2]*v.val[1],
                     val[2]*v.val[0] - val[0]*v.val[2],
                     val[0]*v.val[1] - val[1]*v.val[0]);
}

template<> inline Vec<double, 3> Vec<double, 3>::cross(const Vec<double, 3>& v) const
{
    return Vec<double,3>(val[1]*v.val[2] - val[2]*v.val[1],
                     val[2]*v.val[0] - val[0]*v.val[2],
                     val[0]*v.val[1] - val[1]*v.val[0]);
}

I do see 'val' in the base class of Vec, Matx, so not sure why is this error coming. Possibly some issue with template specialization?

If I comment out the code in the above two functions, compilation succeeds.

Please help!

Thanks and best regards,

Alok