[ 34%] Built target _navfn_generate_messages_check_deps_SetCostmap /home/li/catkin_ws/src/robot_vision/src/getimage.cpp:29:35: error: ‘CV_RETR_EXTERNAL’ was not declared in this scope 29 | findContours(edges, contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE); | ^~~~~~~~~~~~~~~~
时间: 2023-09-11 16:11:23 浏览: 46
看起来你的代码中使用了OpenCV 2.x的API,而CV_RETR_EXTERNAL这个常量在OpenCV 3.x中被改为了cv::RetrievalModes::RETR_EXTERNAL。你可以尝试将代码中的CV_RETR_EXTERNAL替换为cv::RetrievalModes::RETR_EXTERNAL,然后重新编译。如果还有其他类似问题,可以查阅OpenCV官方文档来获取最新的API。
相关问题
#### Running command: "make -j16 -l16" in "/home/wangyize/catkin_racecar/build" #### [ 0%] Built target std_msgs_generate_messages_lisp [ 0%] Built target std_msgs_generate_messages_eus [ 5%] Built target serial [ 5%] Built target std_msgs_generate_messages_py [ 5%] Built target std_msgs_generate_messages_nodejs [ 5%] Built target std_msgs_generate_messages_cpp [ 7%] Built target ackermann_cmd_mux_gencfg make[2]: *** 没有规则可制作目标“/usr/lib/x86_64-linux-gnu/libopencv_calib3d.so.4.2.0”,由“/home/wangyize/catkin_racecar/devel/lib/racecar_gazebo/findLine” 需求。 停止。 [ 7%] Built target nav_msgs_generate_messages_py make[1]: *** [CMakeFiles/Makefile2:3572:racecar/racecar_gazebo/CMakeFiles/findLine.dir/all] 错误 2 make[1]: *** 正在等待未完成的任务.... [ 8%] Built target hokuyo_node_gencfg [ 11%] Built target joy_node [ 14%] Built target libhokuyo [ 14%] Built target rosgraph_msgs_generate_messages_lisp [ 14%] Built target nodelet_generate_messages_eus [ 14%] Built target roscpp_generate_messages_lisp [ 14%] Built target nodelet_generate_messages_lisp [ 14%] Built target rosgraph_msgs_generate_messages_eus [ 14%] Built target rosgraph_msgs_generate_messages_py [ 14%] Built target _vesc_msgs_generate_messages_check_deps_VescState [ 14%] Built target _ackermann_msgs_generate_messages_check_deps_AckermannDriveStamped [ 14%] Built target _ackermann_msgs_generate_messages_check_deps_AckermannDrive [ 14%] Built target _vesc_msgs_generate_messages_check_deps_VescStateStamped make: *** [Makefile:141:all] 错误 2 Invoking "make -j16 -l16" failed
这段输出显示了在执行`make -j16 -l16`命令时出现了错误。错误信息是`没有规则可制作目标"/usr/lib/x86_64-linux-gnu/libopencv_calib3d.so.4.2.0"`,这可能是由于缺少依赖项或文件损坏导致的。建议检查一下依赖项是否已正确安装,或考虑重新安装相关软件包。
bash: /home/eaibot/eairos_ws/devel/setup.bash: No such file or directory
This error message is indicating that the file "setup.bash" does not exist in the specified directory "/home/eaibot/eairos_ws/devel/". This could be due to a few reasons:
1. The directory path is incorrect: Double-check the directory path to make sure it is correct.
2. The file was not generated: If you recently created a new workspace or package, make sure to run the "catkin_make" command to generate the necessary files.
3. The file was deleted: If the file was previously generated and has since been deleted, you will need to regenerate it by running "catkin_make" again.
Once you have confirmed that the file exists in the correct directory, you can source it by running the following command in your terminal:
source /home/eaibot/eairos_ws/devel/setup.bash
This will set the necessary environment variables for your ROS workspace.