Skip to content

error C2039: 'CV_StaticAssert_test' : is not a member of 'cv' #13354

@spcad2

Description

@spcad2
System information (version)
  • OpenCV => 3.4.4
  • Operating System / Platform => Windows 64 Bit
  • IDE => Visual Studio 2017 ver 15.9.3
  • Compiler / Platform Toolset => Visual Studio 2008 (v90)
Detailed description

This issue was introduced in 3.4.4

commit 7f608db
Author: Alexander Alekhin alexander.a.alekhin@gmail.com
Date: Thu Oct 25 03:02:01 2018 +0000

core: move compiler defines from base.hpp into cvdef.h
Steps to reproduce

Compile cpp file that includes "opencv2/core/cvdef.h"

Error :

1>R:\3rdParty\opencv\current\build\x86\install\include\opencv2/core/matx.hpp(561): error C2039: 'CV_StaticAssert_test' : is not a member of 'cv'
1>        R:\3rdParty\opencv\current\build\x86\install\include\opencv2/core/matx.hpp(560) : while compiling class template member function 'cv::Matx<_Tp,m,n>::Matx(_Tp,_Tp,_Tp)'
1>        with
1>        [
1>            _Tp=float,
1>            m=3,
1>            n=1
1>        ]
Potential fix - add namespace cv around template declaration
namespace cv {
template <bool x> struct CV_StaticAssert_failed;
template <> struct CV_StaticAssert_failed<true> { enum { val = 1 }; };
template<int x> struct CV_StaticAssert_test {};
};

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions