Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新加的examples/yolov8.cpp未对c++98兼容 #5637

Closed
wxtshr001 opened this issue Aug 18, 2024 · 0 comments
Closed

新加的examples/yolov8.cpp未对c++98兼容 #5637

wxtshr001 opened this issue Aug 18, 2024 · 0 comments
Labels

Comments

@wxtshr001
Copy link

wxtshr001 commented Aug 18, 2024

error log | 日志或报错信息 | ログ

/home/wang/data/opensource/ncnn/examples/yolov8.cpp: In function ‘void parse_yolov8_detections(float*, float, int, int, int, int, int, std::vector&)’:
/home/wang/data/opensource/ncnn/examples/yolov8.cpp:178:14: error: ‘row_ptr’ does not name a type
auto row_ptr = output.row(i).ptr();
^
/home/wang/data/opensource/ncnn/examples/yolov8.cpp:179:14: error: ‘bboxes_ptr’ does not name a type
auto bboxes_ptr = row_ptr;
^
/home/wang/data/opensource/ncnn/examples/yolov8.cpp:180:14: error: ‘scores_ptr’ does not name a type
auto scores_ptr = row_ptr + 4;
^
/home/wang/data/opensource/ncnn/examples/yolov8.cpp:181:14: error: ‘max_s_ptr’ does not name a type
auto max_s_ptr = std::max_element(scores_ptr, scores_ptr + num_labels);
^
/home/wang/data/opensource/ncnn/examples/yolov8.cpp:182:24: error: ‘max_s_ptr’ was not declared in this scope
float score = *max_s_ptr;
^
/home/wang/data/opensource/ncnn/examples/yolov8.cpp:185:24: error: ‘bboxes_ptr’ was not declared in this scope
float x = *bboxes_ptr++;
^
/home/wang/data/opensource/ncnn/examples/yolov8.cpp:201:40: error: ‘scores_ptr’ was not declared in this scope
object.label = max_s_ptr - scores_ptr;
^
/home/wang/data/opensource/ncnn/examples/yolov8.cpp:204:24: error: ‘class std::vector’ has no member named ‘emplace_back’
detections.emplace_back(object);
^
examples/CMakeFiles/yolov8.dir/build.make:75: recipe for target 'examples/CMakeFiles/yolov8.dir/yolov8.cpp.o' failed
make[2]: *** [examples/CMakeFiles/yolov8.dir/yolov8.cpp.o] Error 1
CMakeFiles/Makefile2:377: recipe for target 'examples/CMakeFiles/yolov8.dir/all' failed
make[1]: *** [examples/CMakeFiles/yolov8.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

context | 编译/运行环境 | バックグラウンド

opencv version: 2.4.13

how to reproduce | 复现步骤 | 再現方法

cmake ..;make -j4

more | 其他 | その他

examples里只有在OpenCV_VERSION_MAJOR > 3的时候才会启用c++11 standard
auto和emplace_back都是c++11才开始支持

@nihui nihui added the bug label Aug 19, 2024
whyb added a commit to whyb/ncnn that referenced this issue Aug 19, 2024
@whyb whyb mentioned this issue Aug 19, 2024
nihui pushed a commit that referenced this issue Aug 20, 2024
@nihui nihui closed this as completed Aug 20, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants