I try to debug a c++ ROS program, it runs until a line of code which is class initialization as
Reader reader(std::string _lidarTopic...)
which read the lidar topic from ROS bag, then the error message as titles popped out, it just touch the definition of class Reader, then runs the following code
_CONSTEXPR20 basic_string(_In_z_ const _Elem* const _Ptr) : _Mypair(_Zero_then_variadic_args_t{}) {
_Construct<_Construct_strategy::_From_ptr>(_Ptr, _Convert_size<size_type>(_Traits::length(_Ptr)));
}
. The definition of class Reader is
class BagReader {
private:
std::string lidarTopic;
rosbag::Bag bag;
rosbag::View view;
}
which have element defined by rosbag. I guess this error is caused by not sourced by setup.bat, but I do not know how to source setup.bat in Microsoft Visual Studio Community 2022