首页 > 其他分享 >opencv 编译报错: error: temporary of non-literal type 'google::protobuf::internal::CallOnceInitial

opencv 编译报错: error: temporary of non-literal type 'google::protobuf::internal::CallOnceInitial

时间:2024-07-05 17:41:17浏览次数:8  
标签:non google protobuf lib internal 报错 CallOnceInitializedMutex include

完整报错:

C:\Users\MyName\MyProject\lib\include\google\protobuf\stubs\mutex.h:124: error: temporary of non-literal type 'google::protobuf::internal::CallOnceInitializedMutex<std::mutex>' in a constant expression
In file included from lib\include/google/protobuf/descriptor.h:66:0,
                 from lib\include/google/protobuf/message.h:121,
                 from lib\include/google/protobuf/generated_message_bases.h:42,
                 from src/protodata/myfile.pb.h:26,
                 from src/myfile/myfile.h:12,
                 from src\myclass/myclass.h:8,
                 from src\mywidget.cpp:2:
lib\include/google/protobuf/stubs/mutex.h: In constructor 'constexpr google::protobuf::internal::WrappedMutex::WrappedMutex()':
lib\include/google/protobuf/stubs/mutex.h:124:29: error: temporary of non-literal type 'google::protobuf::internal::CallOnceInitializedMutex<std::mutex>' in a constant expression
   constexpr WrappedMutex() {}
                             ^
lib\include/google/protobuf/stubs/mutex.h:98:7: note: 'google::protobuf::internal::CallOnceInitializedMutex<std::mutex>' is not literal because:
 class CallOnceInitializedMutex {
       ^~~~~~~~~~~~~~~~~~~~~~~~
lib\include/google/protobuf/stubs/mutex.h:98:7: note:   'google::protobuf::internal::CallOnceInitializedMutex<std::mutex>' has a non-trivial destructor

MinGW GCC: 5.3.0

OpenCV: 4.5.5

参考stackoverflow发现是GCC版本太低

在Opencv源代码中修改: opencv-4.5.5\3rdparty\protobuf\src\google\protobuf\stubs\mutex.h

 

重新编译

 

参考: https://stackoverflow.com/questions/69232278/c-protocol-buffer-temporary-of-non-literal-type-googleprotobufinternal

标签:non,google,protobuf,lib,internal,报错,CallOnceInitializedMutex,include
From: https://www.cnblogs.com/GengMingYan/p/18286307

相关文章

  • pyinstaller打包onnxruntime-gpu报错找不到CUDA的解决方案
    问题说明:使用onnxruntime-gpu完成了深度学习模型部署,但在打包时发生了报错:找不到CUDA具体问题描述:RuntimeError:D:\a\_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:857onnxruntime::python::CreateExecutionProviderInstanceCUDA_PATHissetbutCUDAwas......
  • kaggle运行报错RuntimeError: cutlassF: no kernel found to launch!
    项目场景:项目场景:使用原始Llama3推理,到这里都是能行的!pipinstall-qmodelscopeimporttorchfrommodelscopeimportsnapshot_download,AutoModel,AutoTokenizerimportosmodel_dir=snapshot_download('LLM-Research/Meta-Llama-3-8B-Instruct',cache_dir='/r......
  • 解决nacos报错 Caused by: io.grpc.netty.shaded.io.netty.channel.unix.Errors$Nati
    报错信息:org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)atorg......
  • 海康SDK报错Structure.getFieldOrder()
    就是你调用的这个结构体以及其引用的其他结构体,可能没有getFieldOrder()的方法,你只要按照顺序把他填上去就好了。比如publicstaticclassNET_DVR_TIMEextendsStructure{//校时结构参数publicintdwYear;//年publicintdwMonth;//月......
  • opnEuler下使用xtrabackup报错libgcrypt.so.11
    环境:OS:openEuler2203sp4xtrabackup:2.4.7 [root@19copt]#/opt/xtrabackup-2.4.7/bin/innobackupex--defaults-file=/opt/mysql57/conf/my.cnf--user=root--password=mysql--socket=/tmp/mysql.sock--stream=tar/tmp|gzip>/tmp/mydb.tar.gz/opt/xtrabackup-2.......
  • 1055 - Expression #9 of SELECT list is not in GROUP BY clause and contains nonag
    MySQL8的默认sql_mode包含了only_full_group_by,如果想要sql不按照这模式做检查,可以设置当前session的sql_mode值不包含oly_full_group_by;全局修改则使用以下sql--全局配置session级配置则去掉GlobalSETGLOBALsql_mode='ANSI_QUOTES,STRICT_ALL_TABLES,STRICT_TRANS_TAB......
  • git报错error: failed to push some refs to xxx
    最近在学习git的使用,发现一个本地库同步远程库的问题,先看报错截图:事情经过是,我在自己电脑里创建了一个本地库,在gitee上也创建了一个仓库,我想将我的本地库同步到gitee上的远程,但是却出现了上面的报错。下面是一些前置操作。[email protected]:id7729/git_t......
  • Non-stationary Transformers: Exploring the Stationarity in Time Series Forecasti
    文章目录摘要1引言2相关工作2.1时间序列预测的深度模型2.2时间序列预测的平稳化3非平稳变压器3.1序列平稳化3.2去平稳化注意力核心思想数据平稳化自注意力机制中的去平稳化操作具体流程为什么需要去平稳化操作总结为什么最终预测结果还要进行去平稳化调整后的......
  • 【机器学习】Google开源大模型Gemma2:原理、微调训练及推理部署实战
    目录一、引言二、模型简介2.1 Gemma2概述2.2Gemma2 模型架构三、训练与推理3.1Gemma2 模型训练3.1.1下载基座模型3.1.2 导入依赖库3.1.3量化配置3.1.4分词器和模型实例化3.1.5引入PEFT进行LORA配置 3.1.6样本数据清洗与加载3.1.7模型训练与保存3.......
  • 7.1.SQL注入-基于函数报错的方式来利用updatexml()
    基于函数报错的方式来进行利用-字符型(本页updatexml())前提条件是后台数据库没有屏蔽数据库语法报错信息updatexml()方法详解注释:第一个参数,意思就是xml文档的名称第二个参数,意思就是定位到xml文档中指定的某一个位置的更新第三个参数,意思就是将文档中指定某一个位置......