there are no arguments to '***' that depend on a template parameter, so a declaration of

本文解决了一个常见的Linux编译错误:实参不依赖模板参数。通过添加范围标识来修正该问题,并给出了具体的修正链接。

linux下会出现如下错误:

there are no arguments to '***' that depend on a template parameter, so a declaration of '***' must be available

错误:‘×××’ 的实参不依赖模板参数,所以 ‘×××’ 的声明必须可用

需要在×××之前增加范围标识,参考http://gcc.gnu.org/onlinedocs/gcc/Name-lookup.html

::foo(double) and A::N

In file included from /home/qxn/sp_vision_25-main/tools/logger.cpp:3: /usr/local/include/fmt/chrono.h: In member function ‘decltype (ctx.out()) fmt::v11::formatter<tm, Char>::do_format(const tm&, FormatContext&, const Duration*) const’: /usr/local/include/fmt/chrono.h:2149:55: error: there are no arguments to ‘locale_ref’ that depend on a template parameter, so a declaration of ‘locale_ref’ must be available [-fpermissive] 2149 | auto loc_ref = specs.localized() ? ctx.locale() : locale_ref(); | ^~~~~~~~~~ /usr/local/include/fmt/chrono.h:2149:55: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated) /usr/local/include/fmt/chrono.h: In instantiation of ‘decltype (ctx.out()) fmt::v11::formatter<tm, Char>::do_format(const tm&, FormatContext&, const Duration*) const [with Duration = std::chrono::duration<long int, std::ratio<1, 1000000000> >; FormatContext = fmt::v11::context; Char = char; decltype (ctx.out()) = fmt::v11::basic_appender<char>]’: /usr/local/include/fmt/chrono.h:2201:47: required from ‘decltype (ctx.out()) fmt::v11::formatter<std::chrono::time_point<std::chrono::_V2::system_clock, Duration>, Char>::format(fmt::v11::sys_time<Duration>, FormatContext&) const [with FormatContext = fmt::v11::context; Char = char; Duration = std::chrono::duration<long int, std::ratio<1, 1000000000> >; decltype (ctx.out()) = fmt::v11::basic_appender<char>; fmt::v11::sys_time<Duration> = std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’ /usr/local/include/spdlog/fmt/bundled/base.h:2275:29: required from ‘static void fmt::v11::detail::value<Context>::format_custom(void*, fmt::v11::parse_context<typename Context::char_type>&, Context&) [with T = std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >; Formatter = fmt::v1
10-18
在Windows系统上解决[ 23%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/has_non_zero.avx2.cpp.obj mingw32-make[2]: *** [3rdparty\protobuf\CMakeFiles\libprotobuf.dir\build.make:274: 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/message_lite.cc.obj] Error 1 mingw32-make[1]: *** [CMakeFiles\Makefile2:2318: 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/all] Error 2 mingw32-make[1]: *** Waiting for unfinished jobs.... [ 23%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/matmul.avx2.cpp.obj In file included from D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin.hpp:276:0, from D:/tool/opencv/sources/modules/core/src/precomp.hpp:88, from D:\tool\opencv\cvbuild\modules\core\mathfuncs_core.avx2.cpp:2: D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp: In function 'int64 cv::hal_AVX2::_v256_extract_epi64(const __m256i&)': D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:12: error: there are no arguments to '_mm256_extract_epi64' that depend on a template parameter, so a declaration of '_mm256_extract_epi64' must be available [-fpermissive] return _mm256_extract_epi64(a, i); ^~~~~~~~~~~~~~~~~~~~ D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:12: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) In file included from D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin.hpp:276:0, from D:/tool/opencv/sources/modules/core/src/precomp.hpp:88, from D:\tool\opencv\cvbuild\modules\core\arithm.avx2.cpp:2: D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp: In function 'int64 cv::hal_AVX2::_v256_extract_epi64(const __m256i&)': D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:12: error: there are no arguments to '_mm256_extract_epi64' that depend on a template parameter, so a declaration of '_mm256_extract_epi64' must be available [-fpermissive] return _mm256_extract_epi64(a, i); ^~~~~~~~~~~~~~~~~~~~ D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:12: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) In file included from D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin.hpp:276:0, from In file included from D:/tool/opencv/sources/modules/core/src/precomp.hpp:88D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin.hpp:276:0, from , from D:\tool\opencv\cvbuild\modules\core\convert.avx2.cpp:2D:/tool/opencv/sources/modules/core/src/precomp.hpp:88: , from D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp: In function ': int64 cv::hal_AVX2::_v256_extract_epi64(const __m256i&)D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:': In function 'D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:12: error: ': there are no arguments to 'D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:12:_mm256_extract_epi64 ' that depend on a template parameter, so a declaration of 'error: _mm256_extract_epi64there are no arguments to '' must be available [_mm256_extract_epi64-fpermissive' that depend on a template parameter, so a declaration of '] return (a, i); -fpermissive^~~~~~~~~~~~~~~~~~~~] return _mm256_extract_epi64D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:12:(a, i); (if you use 'D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:12:-fpermissive ', G++ will accept your code, but allowing the use of an undeclared name is deprecated) note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp: In instantiation of 'int64 cv::hal_AVX2::_v256_extract_epi64(const __m256i&) [with int i = 3; int64 = long long int; __m256i = __vector(4) long long int]': D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:2310:42: required from 'uint64 cv::hal_AVX2::v_extract_n(cv::hal_AVX2::v_uint64x4) [with int i = 3; uint64 = long long unsigned int]' D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin.hpp:892:5: required from here D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:32: error: '_mm256_extract_epi64' was not declared in this scope return _mm256_extract_epi64(a, i); ~~~~~~~~~~~~~~~~~~~~^~~~~~ D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:32: note: suggested alternative: '_mm256_extract_epi8' return _mm256_extract_epi64(a, i); ~~~~~~~~~~~~~~~~~~~~^~~~~~ _mm256_extract_epi8 D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp: In instantiation of 'int64 cv::hal_AVX2::_v256_extract_epi64(const __m256i&) [with int i = 3; int64 = long long int; __m256i = __vector(4) long long int]': D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:2310:42: required from 'uint64 cv::hal_AVX2::v_extract_n(cv::hal_AVX2::v_uint64x4) [with int i = 3; uint64 = long long unsigned int]' D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin.hpp:892:5: required from here D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:32: error: '_mm256_extract_epi64' was not declared in this scope return _mm256_extract_epi64(a, i); ~~~~~~~~~~~~~~~~~~~~^~~~~~ D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:32: note: suggested alternative: '_mm256_extract_epi8' return _mm256_extract_epi64(a, i); ~~~~~~~~~~~~~~~~~~~~^~~~~~ _mm256_extract_epi8 mingw32-make[2]: *** [modules\core\CMakeFiles\opencv_core.dir\build.make:1561: modules/core/CMakeFiles/opencv_core.dir/mathfuncs_core.avx2.cpp.obj] Error 1 mingw32-make[2]: *** Waiting for unfinished jobs.... mingw32-make[2]: *** [modules\core\CMakeFiles\opencv_core.dir\build.make:1576: modules/core/CMakeFiles/opencv_core.dir/stat.avx2.cpp.obj] Error 1 D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp: In instantiation of 'int64 cv::hal_AVX2::_v256_extract_epi64(const __m256i&) [with int i = 3; int64 = long long int; __m256i = __vector(4) long long int]': D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:2310:42: required from 'uint64 cv::hal_AVX2::v_extract_n(cv::hal_AVX2::v_uint64x4) [with int i = 3; uint64 = long long unsigned int]' D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin.hpp:892:5: required from here D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:32: error: '_mm256_extract_epi64' was not declared in this scope return _mm256_extract_epi64(a, i); ~~~~~~~~~~~~~~~~~~~~^~~~~~ D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:32: note: suggested alternative: '_mm256_extract_epi8' return _mm256_extract_epi64(a, i); ~~~~~~~~~~~~~~~~~~~~^~~~~~ _mm256_extract_epi8 D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp: In instantiation of 'int64 cv::hal_AVX2::_v256_extract_epi64(const __m256i&) [with int i = 3; int64 = long long int; __m256i = __vector(4) long long int]': D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:2310:42: required from 'uint64 cv::hal_AVX2::v_extract_n(cv::hal_AVX2::v_uint64x4) [with int i = 3; uint64 = long long unsigned int]' D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin.hpp:892:5: required from here D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:32: error: '_mm256_extract_epi64' was not declared in this scope return _mm256_extract_epi64(a, i); ~~~~~~~~~~~~~~~~~~~~^~~~~~ D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:32: note: suggested alternative: '_mm256_extract_epi8' return _mm256_extract_epi64(a, i); ~~~~~~~~~~~~~~~~~~~~^~~~~~ _mm256_extract_epi8 mingw32-make[2]: *** [modules\core\CMakeFiles\opencv_core.dir\build.make:1606: modules/core/CMakeFiles/opencv_core.dir/convert.avx2.cpp.obj] Error 1 In file included from D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin.hpp:276:0, from D:/tool/opencv/sources/modules/core/src/precomp.hpp:88, from D:\tool\opencv\cvbuild\modules\core\convert_scale.avx2.cpp:2: D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp: In function 'int64 cv::hal_AVX2::_v256_extract_epi64(const __m256i&)': D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:12: error: there are no arguments to '_mm256_extract_epi64' that depend on a template parameter, so a declaration of '_mm256_extract_epi64' must be available [-fpermissive] return _mm256_extract_epi64(a, i); ^~~~~~~~~~~~~~~~~~~~ D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:12: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) mingw32-make[2]: *** [modules\core\CMakeFiles\opencv_core.dir\build.make:1591: modules/core/CMakeFiles/opencv_core.dir/arithm.avx2.cpp.obj] Error 1 In file included from D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin.hpp:276:0, from D:/tool/opencv/sources/modules/core/src/precomp.hpp:88, from D:\tool\opencv\cvbuild\modules\core\count_non_zero.avx2.cpp:2: D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp: In function 'int64 cv::hal_AVX2::_v256_extract_epi64(const __m256i&)': D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:12: error: there are no arguments to '_mm256_extract_epi64' that depend on a template parameter, so a declaration of '_mm256_extract_epi64' must be available [-fpermissive] return _mm256_extract_epi64(a, i); ^~~~~~~~~~~~~~~~~~~~ D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:12: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) In file included from D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin.hpp:276:0, from D:/tool/opencv/sources/modules/core/src/precomp.hpp:88, from D:\tool\opencv\cvbuild\modules\core\has_non_zero.avx2.cpp:2: D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp: In function 'int64 cv::hal_AVX2::_v256_extract_epi64(const __m256i&)': D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:12: error: there are no arguments to '_mm256_extract_epi64' that depend on a template parameter, so a declaration of '_mm256_extract_epi64' must be available [-fpermissive] return _mm256_extract_epi64(a, i); ^~~~~~~~~~~~~~~~~~~~ D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:12: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp: In instantiation of 'int64 cv::hal_AVX2::_v256_extract_epi64(const __m256i&) [with int i = 3; int64 = long long int; __m256i = __vector(4) long long int]': D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:2310:42: required from 'uint64 cv::hal_AVX2::v_extract_n(cv::hal_AVX2::v_uint64x4) [with int i = 3; uint64 = long long unsigned int]' D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin.hpp:892:5: required from here D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:32: error: '_mm256_extract_epi64' was not declared in this scope return _mm256_extract_epi64(a, i); ~~~~~~~~~~~~~~~~~~~~^~~~~~ D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:32: note: suggested alternative: '_mm256_extract_epi8' return _mm256_extract_epi64(a, i); ~~~~~~~~~~~~~~~~~~~~^~~~~~ _mm256_extract_epi8 mingw32-make[2]: *** [modules\core\CMakeFiles\opencv_core.dir\build.make:1621: modules/core/CMakeFiles/opencv_core.dir/convert_scale.avx2.cpp.obj] Error 1 In file included from D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin.hpp:276:0, from D:/tool/opencv/sources/modules/core/src/precomp.hpp:88, from D:\tool\opencv\cvbuild\modules\core\matmul.avx2.cpp:2: D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp: In function 'int64 cv::hal_AVX2::_v256_extract_epi64(const __m256i&)': D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:12: error: there are no arguments to '_mm256_extract_epi64' that depend on a template parameter, so a declaration of '_mm256_extract_epi64' must be available [-fpermissive] return _mm256_extract_epi64(a, i); ^~~~~~~~~~~~~~~~~~~~ D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:12: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp: In instantiation of 'int64 cv::hal_AVX2::_v256_extract_epi64(const __m256i&) [with int i = 3; int64 = long long int; __m256i = __vector(4) long long int]': D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:2310:42: required from 'uint64 cv::hal_AVX2::v_extract_n(cv::hal_AVX2::v_uint64x4) [with int i = 3; uint64 = long long unsigned int]' D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin.hpp:892:5: required from here D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:32: error: '_mm256_extract_epi64' was not declared in this scope return _mm256_extract_epi64(a, i); ~~~~~~~~~~~~~~~~~~~~^~~~~~ D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:32: note: suggested alternative: '_mm256_extract_epi8' return _mm256_extract_epi64(a, i); ~~~~~~~~~~~~~~~~~~~~^~~~~~ _mm256_extract_epi8 D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp: In instantiation of 'int64 cv::hal_AVX2::_v256_extract_epi64(const __m256i&) [with int i = 3; int64 = long long int; __m256i = __vector(4) long long int]': D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:2310:42: required from 'uint64 cv::hal_AVX2::v_extract_n(cv::hal_AVX2::v_uint64x4) [with int i = 3; uint64 = long long unsigned int]' D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin.hpp:892:5: required from here D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:32: error: '_mm256_extract_epi64' was not declared in this scope return _mm256_extract_epi64(a, i); ~~~~~~~~~~~~~~~~~~~~^~~~~~ D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:32: note: suggested alternative: '_mm256_extract_epi8' return _mm256_extract_epi64(a, i); ~~~~~~~~~~~~~~~~~~~~^~~~~~ _mm256_extract_epi8 mingw32-make[2]: *** [modules\core\CMakeFiles\opencv_core.dir\build.make:1636: modules/core/CMakeFiles/opencv_core.dir/count_non_zero.avx2.cpp.obj] Error 1 mingw32-make[2]: *** [modules\core\CMakeFiles\opencv_core.dir\build.make:1651: modules/core/CMakeFiles/opencv_core.dir/has_non_zero.avx2.cpp.obj] Error 1 D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp: In instantiation of 'int64 cv::hal_AVX2::_v256_extract_epi64(const __m256i&) [with int i = 3; int64 = long long int; __m256i = __vector(4) long long int]': D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:2310:42: required from 'uint64 cv::hal_AVX2::v_extract_n(cv::hal_AVX2::v_uint64x4) [with int i = 3; uint64 = long long unsigned int]' D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin.hpp:892:5: required from here D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:32: error: '_mm256_extract_epi64' was not declared in this scope return _mm256_extract_epi64(a, i); ~~~~~~~~~~~~~~~~~~~~^~~~~~ D:/tool/opencv/sources/modules/core/include/opencv2/core/hal/intrin_avx.hpp:130:32: note: suggested alternative: '_mm256_extract_epi8' return _mm256_extract_epi64(a, i); ~~~~~~~~~~~~~~~~~~~~^~~~~~ _mm256_extract_epi8 mingw32-make[2]: *** [modules\core\CMakeFiles\opencv_core.dir\build.make:1666: modules/core/CMakeFiles/opencv_core.dir/matmul.avx2.cpp.obj] Error 1 mingw32-make[1]: *** [CMakeFiles\Makefile2:2382: modules/core/CMakeFiles/opencv_core.dir/all] Error 2 mingw32-make: *** [Makefile:165: all] Error 2
最新发布
11-24
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值