LINK : warning C4727 分析


警告:

1>LINK : warning C4727: 具有相同时间戳的名为 xxx.pch 的 PCH 已存在于 aaa.obj 和 bbb.obj 中。  使用第一个 PCH。

MSDN 官方文档:

https://msdn.microsoft.com/zh-cn/library/cfahxw6k.aspx

前面运行的时候一直是没有这个警告的,(哈哈哈)后面手痒,将 stdafx.h  stdafx.cpp 删除了, 想改成不要预编译头的工程,结果有问题,前面文章http://blog.youkuaiyun.com/lcgwust/article/details/75332819 也提过,可以解决。但是,后面的工程文件比较多,加进去也形成了一些问题,就还是按照原来的预编译头文件解决,比较方便快捷,把这两文件加回来,然后修改生成的属性,也没问题。

在debug下,程序没有问题,切换到release下时,出现上面的warning, 于是,修改预编译头文件的生成属性,将release下的属性改为  创建Yc  出现此警告,再改为 Yu,出现错误,没有找到 xxx  文件。


后来,就到处找解决方案了,终于在http://blog.youkuaiyun.com/u014023993/article/details/22648507中找到了可借鉴的解决方案。 

其中的相关解释如下:

在很多程序中,每个源文件都存在一些相同的部分。比如要包含相同的一些头文件,而且这些头文件可能很长,例如window.h。如果用普通的方法编译这些源文件,对这些头文件在每个源文件中的出现都要重新编译,作了很多重复工作。如果能将这些头文件专门进行编译,并且把结果存储起来。然后在编译包含这些头文件的源文件时,使用上述结果替代头文件在源文件中的出现,就可以大大减少工作量。Microsoft Visual C++提供的“预编译头文件”机制就支持这一功能。

所谓的预编译头就是把一个工程中的那一部分代码,预先编译好放在一个文件里(通常以.pch为扩展名),这个文件就称为预编译头文件。这些预先编译好的代码可以是任何的C/C++代码——–甚至是inline的函数,但必须是稳定的,在工程开发的过程中不会被经常改变。如果这些代码被修改,则需要重新编译生成预编译头文件。注意生成预编译头文件是很耗时间的。同时得注意预编译头文件通常很大,通常有6-7M大。注意及时清理那些没有用的预编译头文件。

也许你会问:现在的编译器都有Time stamp的功能,编译器在编译整个工程的时候,它只会编译那些经过修改的文件,而不会去编译那些从上次编译过,到现在没有被修改过的文件。那么为什么还要预编译头文件呢?答案在这里,我们知道编译器是以文件为单位编译的,一个文件经过修改后,会重新编译整个文件,当然在这个文件里包含的所有头文件中的东西都要重新处理一遍。VC的预编译头文件保存的正是这部分信息。以避免每次都要重新处理这些头文件。


 

解决方法:

1、工程属性中的预编译头改为  使用Yu


2、工程中找到stdafx.cpp文件,修改其属性,将预编译头改为 创建Yc



如上步骤,可解决问题。


具体原因,待后续(也可参考文中的链接)

Starting >>> image_subscriber_cpp --- stderr: image_subscriber_cpp cc1plus: warning: /opt/ros/humble/lib/libtf2_ros.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_interfaces__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_interfaces__rosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_interfaces__rosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_interfaces__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_interfaces__rosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_interfaces__rosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_interfaces__rosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_interfaces__rosidl_generator_py.so: not a directory cc1plus: warning: /usr/lib/x86_64-linux-gnu/libpython3.10.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librmw.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcutils.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcpputils.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librosidl_runtime_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomposition_interfaces__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomposition_interfaces__rosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomposition_interfaces__rosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomposition_interfaces__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomposition_interfaces__rosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomposition_interfaces__rosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomposition_interfaces__rosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomposition_interfaces__rosidl_generator_py.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librclcpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomponent_manager.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_generator_py.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libgeometry_msgs__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libgeometry_msgs__rosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libgeometry_msgs__rosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libgeometry_msgs__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libgeometry_msgs__rosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libgeometry_msgs__rosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libgeometry_msgs__rosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libgeometry_msgs__rosidl_generator_py.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libmessage_filters.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libaction_msgs__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libaction_msgs__rosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libaction_msgs__rosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libaction_msgs__rosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libaction_msgs__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libaction_msgs__rosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libaction_msgs__rosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libaction_msgs__rosidl_generator_py.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_action.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librclcpp_action.so: not a directory cc1plus: warning: /usr/lib/x86_64-linux-gnu/libconsole_bridge.so.1.0: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libstd_msgs__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libstd_msgs__rosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libstd_msgs__rosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libstd_msgs__rosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libstd_msgs__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libstd_msgs__rosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libstd_msgs__rosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libstd_msgs__rosidl_generator_py.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2_msgs__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2_msgs__rosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2_msgs__rosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2_msgs__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2_msgs__rosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2_msgs__rosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2_msgs__rosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2_msgs__rosidl_generator_py.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libsensor_msgs__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libsensor_msgs__rosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libsensor_msgs__rosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libsensor_msgs__rosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libsensor_msgs__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libsensor_msgs__rosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libsensor_msgs__rosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libsensor_msgs__rosidl_generator_py.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libvisualization_msgs__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libvisualization_msgs__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libvisualization_msgs__rosidl_typesupport_cpp.so: not a directory /home/lizhuo/ros2_ws/image_subscriber_cpp/src/image_subscriber.cpp: In member function ‘void ImageSubscriber::image_callback(sensor_msgs::msg::Image_<std::allocator<void> >::ConstSharedPtr)’: /home/lizhuo/ros2_ws/image_subscriber_cpp/src/image_subscriber.cpp:110:24: warning: unused variable ‘armor’ [-Wunused-variable] 110 | for (auto& armor : armors) { | ^~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/c++allocator.h:33, from /usr/include/c++/11/bits/allocator.h:46, from /usr/include/c++/11/memory:64, from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:153, from /home/lizhuo/ros2_ws/image_subscriber_cpp/src/image_subscriber.cpp:1: /usr/include/c++/11/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = cv::RotatedRect; _Args = {cv::RotatedRect&, cv::RotatedRect&}; _Tp = cv::RotatedRect]’: /usr/include/c++/11/bits/alloc_traits.h:516:17: required from ‘static void std::allocator_traits<std::allocator<_Tp1> >::construct(std::allocator_traits<std::allocator<_Tp1> >::allocator_type&, _Up*, _Args&& ...) [with _Up = cv::RotatedRect; _Args = {cv::RotatedRect&, cv::RotatedRect&}; _Tp = cv::RotatedRect; std::allocator_traits<std::allocator<_Tp1> >::allocator_type = std::allocator<cv::RotatedRect>]’ /usr/include/c++/11/bits/vector.tcc:115:30: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {cv::RotatedRect&, cv::RotatedRect&}; _Tp = cv::RotatedRect; _Alloc = std::allocator<cv::RotatedRect>; std::vector<_Tp, _Alloc>::reference = cv::RotatedRect&]’ /home/lizhuo/ros2_ws/image_subscriber_cpp/src/image_subscriber.cpp:106:40: required from here /usr/include/c++/11/ext/new_allocator.h:162:11: error: no matching function for call to ‘cv::RotatedRect::RotatedRect(cv::RotatedRect&, cv::RotatedRect&)’ 162 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/opencv4/opencv2/core.hpp:57, from /usr/include/opencv4/opencv2/core/core.hpp:48, from /opt/ros/humble/include/cv_bridge/cv_bridge/cv_bridge.h:43, from /home/lizhuo/ros2_ws/image_subscriber_cpp/src/image_subscriber.cpp:3: /usr/include/opencv4/opencv2/core/types.hpp:535:5: note: candidate: ‘cv::RotatedRect::RotatedRect(const Point2f&, const Point2f&, const Point2f&)’ 535 | RotatedRect(const Point2f& point1, const Point2f& point2, const Point2f& point3); | ^~~~~~~~~~~ /usr/include/opencv4/opencv2/core/types.hpp:535:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/opencv4/opencv2/core.hpp:57, from /usr/include/opencv4/opencv2/core/core.hpp:48, from /opt/ros/humble/include/cv_bridge/cv_bridge/cv_bridge.h:43, from /home/lizhuo/ros2_ws/image_subscriber_cpp/src/image_subscriber.cpp:3: /usr/include/opencv4/opencv2/core/types.hpp:2080:1: note: candidate: ‘cv::RotatedRect::RotatedRect(const Point2f&, const Size2f&, float)’ 2080 | RotatedRect::RotatedRect(const Point2f& _center, const Size2f& _size, float _angle) | ^~~~~~~~~~~ /usr/include/opencv4/opencv2/core/types.hpp:2080:1: note: candidate expects 3 arguments, 2 provided /usr/include/opencv4/opencv2/core/types.hpp:2076:1: note: candidate: ‘cv::RotatedRect::RotatedRect()’ 2076 | RotatedRect::RotatedRect() | ^~~~~~~~~~~ /usr/include/opencv4/opencv2/core/types.hpp:2076:1: note: candidate expects 0 arguments, 2 provided In file included from /usr/include/opencv4/opencv2/core.hpp:57, from /usr/include/opencv4/opencv2/core/core.hpp:48, from /opt/ros/humble/include/cv_bridge/cv_bridge/cv_bridge.h:43, from /home/lizhuo/ros2_ws/image_subscriber_cpp/src/image_subscriber.cpp:3: /usr/include/opencv4/opencv2/core/types.hpp:519:18: note: candidate: ‘cv::RotatedRect::RotatedRect(const cv::RotatedRect&)’ 519 | class CV_EXPORTS RotatedRect | ^~~~~~~~~~~ /usr/include/opencv4/opencv2/core/types.hpp:519:18: note: candidate expects 1 argument, 2 provided /usr/include/opencv4/opencv2/core/types.hpp:519:18: note: candidate: ‘cv::RotatedRect::RotatedRect(cv::RotatedRect&&)’ /usr/include/opencv4/opencv2/core/types.hpp:519:18: note: candidate expects 1 argument, 2 provided gmake[2]: *** [CMakeFiles/image_subscriber.dir/build.make:76:CMakeFiles/image_subscriber.dir/src/image_subscriber.cpp.o] 错误 1 gmake[1]: *** [CMakeFiles/Makefile2:137:CMakeFiles/image_subscriber.dir/all] 错误 2 gmake: *** [Makefile:146:all] 错误 2 --- Failed <<< image_subscriber_cpp [21.9s, exited with code 2] Summary: 0 packages finished [23.1s] 1 package failed: image_subscriber_cpp 1 package had stderr output: image_subscriber_cpp lizhuo@lizhuo-virtual-machine:~/ros2_ws$ sudo apt install g++ [sudo] lizhuo 的密码: 正在读取软件包列表... 完成 正在分析软件包的依赖关系树... 完成 正在读取状态信息... 完成 g++ 已经是最新版 (4:11.2.0-1ubuntu1)。 升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。 lizhuo@lizhuo-virtual-machine:~/ros2_ws$ colcon build Starting >>> image_subscriber_cpp --- stderr: image_subscriber_cpp cc1plus: warning: /opt/ros/humble/lib/libtf2_ros.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_interfaces__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_interfaces__rosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_interfaces__rosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_interfaces__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_interfaces__rosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_interfaces__rosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_interfaces__rosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_interfaces__rosidl_generator_py.so: not a directory cc1plus: warning: /usr/lib/x86_64-linux-gnu/libpython3.10.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librmw.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcutils.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcpputils.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librosidl_runtime_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomposition_interfaces__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomposition_interfaces__rosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomposition_interfaces__rosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomposition_interfaces__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomposition_interfaces__rosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomposition_interfaces__rosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomposition_interfaces__rosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomposition_interfaces__rosidl_generator_py.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librclcpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libcomponent_manager.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_generator_py.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libgeometry_msgs__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libgeometry_msgs__rosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libgeometry_msgs__rosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libgeometry_msgs__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libgeometry_msgs__rosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libgeometry_msgs__rosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libgeometry_msgs__rosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libgeometry_msgs__rosidl_generator_py.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libmessage_filters.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libaction_msgs__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libaction_msgs__rosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libaction_msgs__rosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libaction_msgs__rosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libaction_msgs__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libaction_msgs__rosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libaction_msgs__rosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libaction_msgs__rosidl_generator_py.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librcl_action.so: not a directory cc1plus: warning: /opt/ros/humble/lib/librclcpp_action.so: not a directory cc1plus: warning: /usr/lib/x86_64-linux-gnu/libconsole_bridge.so.1.0: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libstd_msgs__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libstd_msgs__rosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libstd_msgs__rosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libstd_msgs__rosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libstd_msgs__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libstd_msgs__rosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libstd_msgs__rosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libstd_msgs__rosidl_generator_py.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2_msgs__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2_msgs__rosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2_msgs__rosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2_msgs__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2_msgs__rosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2_msgs__rosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2_msgs__rosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libtf2_msgs__rosidl_generator_py.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libsensor_msgs__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libsensor_msgs__rosidl_typesupport_fastrtps_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libsensor_msgs__rosidl_typesupport_fastrtps_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libsensor_msgs__rosidl_typesupport_introspection_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libsensor_msgs__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libsensor_msgs__rosidl_typesupport_introspection_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libsensor_msgs__rosidl_typesupport_cpp.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libsensor_msgs__rosidl_generator_py.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libvisualization_msgs__rosidl_generator_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libvisualization_msgs__rosidl_typesupport_c.so: not a directory cc1plus: warning: /opt/ros/humble/lib/libvisualization_msgs__rosidl_typesupport_cpp.so: not a directory /home/lizhuo/ros2_ws/image_subscriber_cpp/src/image_subscriber.cpp: In member function ‘void ImageSubscriber::image_callback(sensor_msgs::msg::Image_<std::allocator<void> >::ConstSharedPtr)’: /home/lizhuo/ros2_ws/image_subscriber_cpp/src/image_subscriber.cpp:110:24: warning: unused variable ‘armor’ [-Wunused-variable] 110 | for (auto& armor : armors) { | ^~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/c++allocator.h:33, from /usr/include/c++/11/bits/allocator.h:46, from /usr/include/c++/11/memory:64, from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:153, from /home/lizhuo/ros2_ws/image_subscriber_cpp/src/image_subscriber.cpp:1: /usr/include/c++/11/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = cv::RotatedRect; _Args = {cv::RotatedRect&, cv::RotatedRect&}; _Tp = cv::RotatedRect]’: /usr/include/c++/11/bits/alloc_traits.h:516:17: required from ‘static void std::allocator_traits<std::allocator<_Tp1> >::construct(std::allocator_traits<std::allocator<_Tp1> >::allocator_type&, _Up*, _Args&& ...) [with _Up = cv::RotatedRect; _Args = {cv::RotatedRect&, cv::RotatedRect&}; _Tp = cv::RotatedRect; std::allocator_traits<std::allocator<_Tp1> >::allocator_type = std::allocator<cv::RotatedRect>]’ /usr/include/c++/11/bits/vector.tcc:115:30: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {cv::RotatedRect&, cv::RotatedRect&}; _Tp = cv::RotatedRect; _Alloc = std::allocator<cv::RotatedRect>; std::vector<_Tp, _Alloc>::reference = cv::RotatedRect&]’ /home/lizhuo/ros2_ws/image_subscriber_cpp/src/image_subscriber.cpp:106:40: required from here /usr/include/c++/11/ext/new_allocator.h:162:11: error: no matching function for call to ‘cv::RotatedRect::RotatedRect(cv::RotatedRect&, cv::RotatedRect&)’ 162 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/opencv4/opencv2/core.hpp:57, from /usr/include/opencv4/opencv2/core/core.hpp:48, from /opt/ros/humble/include/cv_bridge/cv_bridge/cv_bridge.h:43, from /home/lizhuo/ros2_ws/image_subscriber_cpp/src/image_subscriber.cpp:3: /usr/include/opencv4/opencv2/core/types.hpp:535:5: note: candidate: ‘cv::RotatedRect::RotatedRect(const Point2f&, const Point2f&, const Point2f&)’ 535 | RotatedRect(const Point2f& point1, const Point2f& point2, const Point2f& point3); | ^~~~~~~~~~~ /usr/include/opencv4/opencv2/core/types.hpp:535:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/opencv4/opencv2/core.hpp:57, from /usr/include/opencv4/opencv2/core/core.hpp:48, from /opt/ros/humble/include/cv_bridge/cv_bridge/cv_bridge.h:43, from /home/lizhuo/ros2_ws/image_subscriber_cpp/src/image_subscriber.cpp:3: /usr/include/opencv4/opencv2/core/types.hpp:2080:1: note: candidate: ‘cv::RotatedRect::RotatedRect(const Point2f&, const Size2f&, float)’ 2080 | RotatedRect::RotatedRect(const Point2f& _center, const Size2f& _size, float _angle) | ^~~~~~~~~~~ /usr/include/opencv4/opencv2/core/types.hpp:2080:1: note: candidate expects 3 arguments, 2 provided /usr/include/opencv4/opencv2/core/types.hpp:2076:1: note: candidate: ‘cv::RotatedRect::RotatedRect()’ 2076 | RotatedRect::RotatedRect() | ^~~~~~~~~~~ /usr/include/opencv4/opencv2/core/types.hpp:2076:1: note: candidate expects 0 arguments, 2 provided In file included from /usr/include/opencv4/opencv2/core.hpp:57, from /usr/include/opencv4/opencv2/core/core.hpp:48, from /opt/ros/humble/include/cv_bridge/cv_bridge/cv_bridge.h:43, from /home/lizhuo/ros2_ws/image_subscriber_cpp/src/image_subscriber.cpp:3: /usr/include/opencv4/opencv2/core/types.hpp:519:18: note: candidate: ‘cv::RotatedRect::RotatedRect(const cv::RotatedRect&)’ 519 | class CV_EXPORTS RotatedRect | ^~~~~~~~~~~ /usr/include/opencv4/opencv2/core/types.hpp:519:18: note: candidate expects 1 argument, 2 provided /usr/include/opencv4/opencv2/core/types.hpp:519:18: note: candidate: ‘cv::RotatedRect::RotatedRect(cv::RotatedRect&&)’ /usr/include/opencv4/opencv2/core/types.hpp:519:18: note: candidate expects 1 argument, 2 provided gmake[2]: *** [CMakeFiles/image_subscriber.dir/build.make:76:CMakeFiles/image_subscriber.dir/src/image_subscriber.cpp.o] 错误 1 gmake[1]: *** [CMakeFiles/Makefile2:137:CMakeFiles/image_subscriber.dir/all] 错误 2 gmake: *** [Makefile:146:all] 错误 2 --- Failed <<< image_subscriber_cpp [14.0s, exited with code 2] Summary: 0 packages finished [15.1s] 1 package failed: image_subscriber_cpp 1 package had stderr output: image_subscriber_cpp
最新发布
08-12
root@ubuntu:/home/t101/paho.mqtt.c-master# make mkdir -p build/output/samples mkdir -p build/output/test echo OSTYPE is Linux OSTYPE is Linux sed -e "s/@CLIENT_VERSION@/1.3.0/g" -e "s/@BUILD_TIMESTAMP@/Thu Jun 19 06:23:05 PDT 2025/g" src/VersionInfo.h.in > build/VersionInfo.h arm-linux-gcc -g -fPIC -I/home/t101/sysdir/ssl/include/ -Os -Wall -Ibuild -o build/output/libpaho-mqtt3c.so.1.0 src/Heap.c src/Socket.c src/MQTTProtocolClient.c src/MQTTProtocolOut.c src/SHA1.c src/StackTrace.c src/MQTTProperties.c src/MQTTPersistenceDefault.c src/MQTTPacketOut.c src/WebSocket.c src/Clients.c src/OsWrapper.c src/MQTTPacket.c src/Base64.c src/MQTTClient.c src/Log.c src/Thread.c src/LinkedList.c src/MQTTReasonCodes.c src/MQTTPersistence.c src/utf-8.c src/SocketBuffer.c src/Tree.c src/Messages.c -L/home/t101/sysdir/ssl/lib -shared -Wl,-init,MQTTClient_init -lpthread -Wl,-soname,libpaho-mqtt3c.so.1 src/SHA1.c: In function `SHA1_ProcessBlock': src/SHA1.c:112: warning: implicit declaration of function `__builtin_bswap32' src/WebSocket.c: In function `WebSocket_buildFrame': src/WebSocket.c:225: warning: implicit declaration of function `__builtin_bswap16' src/WebSocket.c:230: warning: integer constant is too large for "long" type src/WebSocket.c:230: warning: comparison is always true due to limited range of data type src/WebSocket.c:232: warning: implicit declaration of function `__builtin_bswap64' src/WebSocket.c: In function `WebSocket_calculateFrameHeaderSize': src/WebSocket.c:297: warning: integer constant is too large for "long" type src/WebSocket.c:297: warning: comparison is always true due to limited range of data type ln -s libpaho-mqtt3c.so.1.0 build/output/libpaho-mqtt3c.so.1 ln -s libpaho-mqtt3c.so.1 build/output/libpaho-mqtt3c.so arm-linux-gcc -g -fPIC -I/home/t101/sysdir/ssl/include/ -Os -Wall -Ibuild -o build/output/libpaho-mqtt3cs.so.1.0 src/Heap.c src/Socket.c src/SSLSocket.c src/MQTTProtocolClient.c src/MQTTProtocolOut.c src/SHA1.c src/StackTrace.c src/MQTTProperties.c src/MQTTPersistenceDefault.c src/MQTTPacketOut.c src/WebSocket.c src/Clients.c src/OsWrapper.c src/MQTTPacket.c src/Base64.c src/MQTTClient.c src/Log.c src/Thread.c src/LinkedList.c src/MQTTReasonCodes.c src/MQTTPersistence.c src/utf-8.c src/SocketBuffer.c src/Tree.c src/Messages.c -DOPENSSL -L/home/t101/sysdir/ssl/lib -shared -Wl,--start-group -lpthread -ldl -lssl -lcrypto -Wl,--end-group -Wl,-init,MQTTClient_init -Wl,-soname,libpaho-mqtt3cs.so.1 -Wl,-no-whole-archive src/SSLSocket.c: In function `SSLSocket_createContext': src/SSLSocket.c:537: warning: `TLSv1_client_method' is deprecated (declared at /home/t101/sysdir/ssl/include/openssl/ssl.h:1866) src/SSLSocket.c:542: warning: `TLSv1_1_client_method' is deprecated (declared at /home/t101/sysdir/ssl/include/openssl/ssl.h:1872) src/SSLSocket.c:547: warning: `TLSv1_2_client_method' is deprecated (declared at /home/t101/sysdir/ssl/include/openssl/ssl.h:1878) src/SSLSocket.c: In function `SSLSocket_initialize': src/SSLSocket.c:476: warning: statement with no effect src/WebSocket.c: In function `WebSocket_buildFrame': src/WebSocket.c:225: warning: implicit declaration of function `__builtin_bswap16' src/WebSocket.c:230: warning: integer constant is too large for "long" type src/WebSocket.c:230: warning: comparison is always true due to limited range of data type src/WebSocket.c:232: warning: implicit declaration of function `__builtin_bswap64' src/WebSocket.c: In function `WebSocket_calculateFrameHeaderSize': src/WebSocket.c:297: warning: integer constant is too large for "long" type src/WebSocket.c:297: warning: comparison is always true due to limited range of data type ln -s libpaho-mqtt3cs.so.1.0 build/output/libpaho-mqtt3cs.so.1 ln -s libpaho-mqtt3cs.so.1 build/output/libpaho-mqtt3cs.so arm-linux-gcc -g -fPIC -I/home/t101/sysdir/ssl/include/ -Os -Wall -Ibuild -o build/output/libpaho-mqtt3a.so.1.0 src/Heap.c src/Socket.c src/MQTTProtocolClient.c src/MQTTProtocolOut.c src/MQTTAsync.c src/SHA1.c src/StackTrace.c src/MQTTProperties.c src/MQTTPersistenceDefault.c src/MQTTPacketOut.c src/WebSocket.c src/Clients.c src/OsWrapper.c src/MQTTPacket.c src/Base64.c src/Log.c src/Thread.c src/LinkedList.c src/MQTTReasonCodes.c src/MQTTPersistence.c src/utf-8.c src/SocketBuffer.c src/Tree.c src/Messages.c -L/home/t101/sysdir/ssl/lib -shared -Wl,-init,MQTTAsync_init -lpthread -Wl,-soname,libpaho-mqtt3a.so.1 src/SHA1.c: In function `SHA1_ProcessBlock': src/SHA1.c:112: warning: implicit declaration of function `__builtin_bswap32' src/WebSocket.c: In function `WebSocket_buildFrame': src/WebSocket.c:225: warning: implicit declaration of function `__builtin_bswap16' src/WebSocket.c:230: warning: integer constant is too large for "long" type src/WebSocket.c:230: warning: comparison is always true due to limited range of data type src/WebSocket.c:232: warning: implicit declaration of function `__builtin_bswap64' src/WebSocket.c: In function `WebSocket_calculateFrameHeaderSize': src/WebSocket.c:297: warning: integer constant is too large for "long" type src/WebSocket.c:297: warning: comparison is always true due to limited range of data type ln -s libpaho-mqtt3a.so.1.0 build/output/libpaho-mqtt3a.so.1 ln -s libpaho-mqtt3a.so.1 build/output/libpaho-mqtt3a.so arm-linux-gcc -g -fPIC -I/home/t101/sysdir/ssl/include/ -Os -Wall -Ibuild -o build/output/libpaho-mqtt3as.so.1.0 src/Heap.c src/Socket.c src/SSLSocket.c src/MQTTProtocolClient.c src/MQTTProtocolOut.c src/MQTTAsync.c src/SHA1.c src/StackTrace.c src/MQTTProperties.c src/MQTTPersistenceDefault.c src/MQTTPacketOut.c src/WebSocket.c src/Clients.c src/OsWrapper.c src/MQTTPacket.c src/Base64.c src/Log.c src/Thread.c src/LinkedList.c src/MQTTReasonCodes.c src/MQTTPersistence.c src/utf-8.c src/SocketBuffer.c src/Tree.c src/Messages.c -DOPENSSL -L/home/t101/sysdir/ssl/lib -shared -Wl,--start-group -lpthread -ldl -lssl -lcrypto -Wl,--end-group -Wl,-init,MQTTAsync_init -Wl,-soname,libpaho-mqtt3as.so.1 -Wl,-no-whole-archive src/SSLSocket.c: In function `SSLSocket_createContext': src/SSLSocket.c:537: warning: `TLSv1_client_method' is deprecated (declared at /home/t101/sysdir/ssl/include/openssl/ssl.h:1866) src/SSLSocket.c:542: warning: `TLSv1_1_client_method' is deprecated (declared at /home/t101/sysdir/ssl/include/openssl/ssl.h:1872) src/SSLSocket.c:547: warning: `TLSv1_2_client_method' is deprecated (declared at /home/t101/sysdir/ssl/include/openssl/ssl.h:1878) src/SSLSocket.c: In function `SSLSocket_initialize': src/SSLSocket.c:476: warning: statement with no effect src/WebSocket.c: In function `WebSocket_buildFrame': src/WebSocket.c:225: warning: implicit declaration of function `__builtin_bswap16' src/WebSocket.c:230: warning: integer constant is too large for "long" type src/WebSocket.c:230: warning: comparison is always true due to limited range of data type src/WebSocket.c:232: warning: implicit declaration of function `__builtin_bswap64' src/WebSocket.c: In function `WebSocket_calculateFrameHeaderSize': src/WebSocket.c:297: warning: integer constant is too large for "long" type src/WebSocket.c:297: warning: comparison is always true due to limited range of data type ln -s libpaho-mqtt3as.so.1.0 build/output/libpaho-mqtt3as.so.1 ln -s libpaho-mqtt3as.so.1 build/output/libpaho-mqtt3as.so arm-linux-gcc -L/home/t101/sysdir/ssl/lib -I src -lpthread -L build/output -o build/output/paho_c_version -lpaho-mqtt3a src/MQTTVersion.c -ldl build/output/libpaho-mqtt3a.so: undefined reference to `clock_gettime' build/output/libpaho-mqtt3a.so: undefined reference to `__builtin_bswap16' build/output/libpaho-mqtt3a.so: undefined reference to `__builtin_bswap32' build/output/libpaho-mqtt3a.so: undefined reference to `__builtin_bswap64' collect2: ld returned 1 exit status Makefile:274: recipe for target 'build/output/paho_c_version' failed make: *** [build/output/paho_c_version] Error 1
06-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值