6.27-C++手记

TOC

前言

  • 记下错误!

正文

  • 不要试图在CLion中对程序进行排错,只有在catkin_make后,CLion中才能够无错
  • rosconfig文件里面不能出现汉字编码,不然编译会报错
  • 注意std::string
  • ```#include "proxy.h"
  • ISO C++ forbids declaration of ‘ with no type [-fpermissive]

  • 头文件和实现文件的函数不符合
  • error: no matching function for call

  • 函数用错了,往往是参数错误
  • make zsProxy
  • 注意编译子标
  • 服务的回调函数返回类型必须为bool,订阅的回调函数返回类型必须为void
  • 回调函数记得用bind绑定
  • zs_pose_sub_ = nh_.subscribe<:pose>("zs_pose", 1, (boost::function )boost::bind(&Proxy::reconfigParameterCB, this, _1 ));

  • 用tf函数记得include
  • include "tf/tf.h"

  • cannot convert ‘std::basic_string<char>’ to ‘const char*’

  • system(("rosrun dynamic_reconfigure dynparam set RosAria zsstart_pose_x " + start_pose_x_str_).c_str());
  • Undefined reference to ros::xx
  • 没有链接catkin_libraries
target_link_libraries(zsProxy
  ${catkin_LIBRARIES}
)
  • extra qualification ‘ProxyNode::’ on member ‘sendGoalCB’ [-fpermissive]
  • 在类定义中的函数声明中写了类名作用域

转载于:https://www.cnblogs.com/lizhensheng/p/11117538.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值