【PaddleOCR报错】cc1plus: error: too many filenames given

本文参考自https://blog.csdn.net/weixin_40026739/article/details/129741274

 执行指令sudo ./tools/build.sh后,会出现如下报错

cc1plus: error: too many filenames given.  Type cc1plus --help for usage
cc1plus: fatal error: CMakeFiles/ppocr.dir/src/args.cpp.d: 没有那个文件或目录
compilation terminated.
cc1plus: error: too many filenames given.  Type cc1plus --help for usage
cc1plus: fatal error: CMakeFiles/ppocr.dir/src/ocr_rec.cpp.d: 没有那个文件或目录
compilation terminated.
CMakeFiles/ppocr.dir/build.make:75: recipe for target 'CMakeFiles/ppocr.dir/src/args.cpp.o' failed
cc1plus: error: too many filenames given.  Type cc1plus --help for usage
cc1plus: error: too many filenames given.  Type cc1plus --help for usage
cc1plus: error: too many filenames given.  Type cc1plus --help for usage
cc1plus: fatal error: CMakeFiles/ppocr.dir/src/ocr_det.cpp.d: 没有那个文件或目录
cc1plus: fatal error: CMakeFiles/ppocr.dir/src/main.cpp.d: 没有那个文件或目录
compilation terminated.
compilation terminated.
make[2]: *** [CMakeFiles/ppocr.dir/src/args.cpp.o] Error 1
cc1plus: fatal error: CMakeFiles/ppocr.dir/src/clipper.cpp.d: 没有那个文件或目录
compilation terminated.
CMakeFiles/ppocr.dir/build.make:145: recipe for target 'CMakeFiles/ppocr.dir/src/ocr_rec.cpp.o' failed
make[2]: *** [CMakeFiles/ppocr.dir/src/ocr_rec.cpp.o] Error 1
CMakeFiles/ppocr.dir/build.make:131: recipe for target 'CMakeFiles/ppocr.dir/src/ocr_det.cpp.o' failed
make[2]: *** [CMakeFiles/ppocr.dir/src/ocr_det.cpp.o] Error 1
CMakeFiles/ppocr.dir/build.make:103: recipe for target 'CMakeFiles/ppocr.dir/src/main.cpp.o' failed
make[2]: *** [CMakeFiles/ppocr.dir/src/main.cpp.o] Error 1
CMakeFiles/ppocr.dir/build.make:89: recipe for target 'CMakeFiles/ppocr.dir/src/clipper.cpp.o' failed
make[2]: *** [CMakeFiles/ppocr.dir/src/clipper.cpp.o] Error 1
cc1plus: error: too many filenames given.  Type cc1plus --help for usage
cc1plus: fatal error: CMakeFiles/ppocr.dir/src/postprocess_op.cpp.d: 没有那个文件或目录
compilation terminated.
CMakeFiles/ppocr.dir/build.make:187: recipe for target 'CMakeFiles/ppocr.dir/src/postprocess_op.cpp.o' failed
make[2]: *** [CMakeFiles/ppocr.dir/src/postprocess_op.cpp.o] Error 1
cc1plus: error: too many filenames given.  Type cc1plus --help for usage
cc1plus: error: too many filenames given.  Type cc1plus --help for usage
cc1plus: error: too many filenames given.  Type cc1plus --help for usage
cc1plus: fatal error: CMakeFiles/ppocr.dir/src/structure_layout.cpp.d: 没有那个文件或目录
compilation terminated.
cc1plus: fatal error: CMakeFiles/ppocr.dir/src/ocr_cls.cpp.d: 没有那个文件或目录
compilation terminated.
cc1plus: fatal error: CMakeFiles/ppocr.dir/src/structure_table.cpp.d: 没有那个文件或目录
compilation terminated.
CMakeFiles/ppocr.dir/build.make:215: recipe for target 'CMakeFiles/ppocr.dir/src/structure_layout.cpp.o' failed
make[2]: *** [CMakeFiles/ppocr.dir/src/structure_layout.cpp.o] Error 1
CMakeFiles/ppocr.dir/build.make:117: recipe for target 'CMakeFiles/ppocr.dir/src/ocr_cls.cpp.o' failed
make[2]: *** [CMakeFiles/ppocr.dir/src/ocr_cls.cpp.o] Error 1
CMakeFiles/ppocr.dir/build.make:229: recipe for target 'CMakeFiles/ppocr.dir/src/structure_table.cpp.o' failed
make[2]: *** [CMakeFiles/ppocr.dir/src/structure_table.cpp.o] Error 1
cc1plus: error: too many filenames given.  Type cc1plus --help for usage
cc1plus: error: too many filenames given.  Type cc1plus --help for usage
cc1plus: error: too many filenames given.  Type cc1plus --help for usage
cc1plus: fatal error: CMakeFiles/ppocr.dir/src/utility.cpp.d: 没有那个文件或目录
compilation terminated.
cc1plus: fatal error: CMakeFiles/ppocr.dir/src/preprocess_op.cpp.d: 没有那个文件或目录
compilation terminated.
cc1plus: fatal error: CMakeFiles/ppocr.dir/src/paddleocr.cpp.d: 没有那个文件或目录
compilation terminated.
cc1plus: error: too many filenames given.  Type cc1plus --help for usage
cc1plus: fatal error: CMakeFiles/ppocr.dir/src/paddlestructure.cpp.d: 没有那个文件或目录
compilation terminated.
CMakeFiles/ppocr.dir/build.make:243: recipe for target 'CMakeFiles/ppocr.dir/src/utility.cpp.o' failed
make[2]: *** [CMakeFiles/ppocr.dir/src/utility.cpp.o] Error 1
CMakeFiles/ppocr.dir/build.make:201: recipe for target 'CMakeFiles/ppocr.dir/src/preprocess_op.cpp.o' failed
make[2]: *** [CMakeFiles/ppocr.dir/src/preprocess_op.cpp.o] Error 1
CMakeFiles/ppocr.dir/build.make:159: recipe for target 'CMakeFiles/ppocr.dir/src/paddleocr.cpp.o' failed
make[2]: *** [CMakeFiles/ppocr.dir/src/paddleocr.cpp.o] Error 1
CMakeFiles/ppocr.dir/build.make:173: recipe for target 'CMakeFiles/ppocr.dir/src/paddlestructure.cpp.o' failed
make[2]: *** [CMakeFiles/ppocr.dir/src/paddlestructure.cpp.o] Error 1
CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/ppocr.dir/all' failed
make[1]: *** [CMakeFiles/ppocr.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2

报错在终端显示如下图

 解决办法,找到

~/ocr/01/PaddleOCR/deploy/cpp_infer/CMakeLists.txt

将 "-o3" 改成 "-O3" 就可以了,修改后的结果如下,

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O3 ${FLAG_OPENMP} -std=c++11")

这应该是一个打字错误引起的,不理解为什么官方没有修正过来

修改如下路径如下

  • 24
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值