MNN 编译时,提示Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR)

在编译MNN时,由于protobuf已编译在自定义路径,但是cmake时,却提示Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR),在/etc/profile中添加环境变量后,还是无用。

提示如下图所示

解决方法:cmake 时用-DCMAKE_PREFIX_PATH指定protobuf所在路径

cmake -DCMAKE_PREFIX_PATH=/usr/protobuf ..

/usr/protobuf为protobuf编译安装的路径

  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用中提到了使用cmake可以通过指定-DCMAKE_PREFIX_PATH选项来指定protobuf库的路径。具体的命令是: cmake -DCMAKE_PREFIX_PATH=/usr/protobuf .. 引用中提到了手动编译和安装protobuf库的方法。在步骤四中,使用了-DProtobuf_LIBRARIES和-DProtobuf_INCLUDE_DIR来指定protobuf库的路径。具体的命令是: cmake . -B build -DProtobuf_LIBRARIES=C:\protobuf-21.12\lib -DProtobuf_INCLUDE_DIR=C:\protobuf-21.12\include 综上所述,要在cmake中指定protobuf库的路径,可以使用-DCMAKE_PREFIX_PATH选项或者-DProtobuf_LIBRARIES和-DProtobuf_INCLUDE_DIR选项来指定。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [MNN 编译提示Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR)](https://blog.csdn.net/mushroom_tom/article/details/121792124)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *3* [Could NOT find Protobuf (missing: Protobuf_LIBRARIES Protobuf_INCLUDE_DIR)](https://blog.csdn.net/weixin_37684231/article/details/128845367)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值