C++编程:boost::cv_status相关的测试程序

411 篇文章 ¥29.90 ¥99.00
本文介绍了C++ Boost库中的boost::cv_status枚举类型,用于表示条件变量的状态。通过一个生产者-消费者线程模型的测试程序,详细展示了如何使用boost::cv_status进行线程间的同步和通信,以及处理等待超时的情况。

C++编程:boost::cv_status相关的测试程序

boost::cv_status是Boost库中的一个类型,用于表示条件变量(condition variable)的状态。条件变量是多线程编程中常用的同步机制,用于线程之间的通信和同步操作。在本文中,我们将介绍boost::cv_status的用法,并提供一个相关的测试程序。

首先,让我们来看一下boost::cv_status的定义:

namespace boost {
   
   
    enum class cv_status {
   
   
        no_timeout,
        timeout
    };
}

boost::cv_status是一个枚举类,它有两个成

[ 78%] Linking CXX executable ../Examples/Monocular/mono_tum [ 80%] Linking CXX executable ../Examples/Monocular-Inertial/mono_inertial_euroc /usr/bin/ld: CMakeFiles/mono_tum_old.dir/Examples_old/Monocular/mono_tum.cc.o: in function `main': mono_tum.cc:(.text.startup+0x451): undefined reference to `cv::imread(std::string const&, int)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `boost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traits<char> >::load(std::string&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `pangolin::Split(std::string const&, char)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `boost::archive::text_oarchive_impl<boost::archive::text_oarchive>::save(std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::putText(cv::_InputOutputArray const&, std::string const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::getTextSize(std::string const&, int, double, int, int*)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::FileStorage::FileStorage(std::string const&, int, std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::namedWindow(std::string const&, int)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::FileNode::string() const' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::FileStorage::operator[](std::string const&) const' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::error(int, std::string const&, char const*, char const*, int)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `DBoW2::FORB::toString(cv::Mat const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `pangolin::CreateWindowAndBind(std::string, int, int, pangolin::Params const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::write(cv::FileStorage&, std::string const&, int)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `boost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits<char> >::save(std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `DBoW2::FORB::fromString(cv::Mat&, std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `pangolin::CreatePanel(std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::operator<<(cv::FileStorage&, std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::write(cv::FileStorage&, std::string const&, double)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::load(std::string&)' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/mono_tum_old.dir/build.make:132:../Examples_old/Monocular/mono_tum_old] 错误 1 make[1]: *** [CMakeFiles/Makefile2:201:CMakeFiles/mono_tum_old.dir/all] 错误 2 make[1]: *** 正在等待未完成的任务.... /usr/bin/ld: CMakeFiles/mono_tum.dir/Examples/Monocular/mono_tum.cc.o: in function `main': mono_tum.cc:(.text.startup+0x451): undefined reference to `cv::imread(std::string const&, int)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `boost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traits<char> >::load(std::string&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `pangolin::Split(std::string const&, char)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `boost::archive::text_oarchive_impl<boost::archive::text_oarchive>::save(std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::putText(cv::_InputOutputArray const&, std::string const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::getTextSize(std::string const&, int, double, int, int*)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::FileStorage::FileStorage(std::string const&, int, std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::namedWindow(std::string const&, int)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::FileNode::string() const' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::FileStorage::operator[](std::string const&) const' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::error(int, std::string const&, char const*, char const*, int)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `DBoW2::FORB::toString(cv::Mat const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `pangolin::CreateWindowAndBind(std::string, int, int, pangolin::Params const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::write(cv::FileStorage&, std::string const&, int)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `boost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits<char> >::save(std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `DBoW2::FORB::fromString(cv::Mat&, std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `pangolin::CreatePanel(std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::operator<<(cv::FileStorage&, std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::write(cv::FileStorage&, std::string const&, double)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::load(std::string&)' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/mono_tum.dir/build.make:132:../Examples/Monocular/mono_tum] 错误 1 make[1]: *** [CMakeFiles/Makefile2:174:CMakeFiles/mono_tum.dir/all] 错误 2 /usr/bin/ld: CMakeFiles/mono_inertial_euroc.dir/Examples/Monocular-Inertial/mono_inertial_euroc.cc.o: in function `main': mono_inertial_euroc.cc:(.text.startup+0xa8b): undefined reference to `cv::imread(std::string const&, int)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `boost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traits<char> >::load(std::string&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `pangolin::Split(std::string const&, char)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `boost::archive::text_oarchive_impl<boost::archive::text_oarchive>::save(std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::putText(cv::_InputOutputArray const&, std::string const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::getTextSize(std::string const&, int, double, int, int*)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::FileStorage::FileStorage(std::string const&, int, std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::namedWindow(std::string const&, int)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::FileNode::string() const' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::FileStorage::operator[](std::string const&) const' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::error(int, std::string const&, char const*, char const*, int)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `DBoW2::FORB::toString(cv::Mat const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `pangolin::CreateWindowAndBind(std::string, int, int, pangolin::Params const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::write(cv::FileStorage&, std::string const&, int)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `boost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits<char> >::save(std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `DBoW2::FORB::fromString(cv::Mat&, std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `pangolin::CreatePanel(std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::operator<<(cv::FileStorage&, std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::write(cv::FileStorage&, std::string const&, double)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::load(std::string&)' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/mono_inertial_euroc.dir/build.make:132:../Examples/Monocular-Inertial/mono_inertial_euroc] 错误 1 make[1]: *** [CMakeFiles/Makefile2:147:CMakeFiles/mono_inertial_euroc.dir/all] 错误 2 [ 81%] Linking CXX executable ../Examples_old/Monocular-Inertial/mono_inertial_tum_vi_old /usr/bin/ld: CMakeFiles/mono_inertial_tum_vi_old.dir/Examples_old/Monocular-Inertial/mono_inertial_tum_vi.cc.o: in function `main': mono_inertial_tum_vi.cc:(.text.startup+0x890): undefined reference to `cv::imread(std::string const&, int)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `boost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traits<char> >::load(std::string&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `pangolin::Split(std::string const&, char)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `boost::archive::text_oarchive_impl<boost::archive::text_oarchive>::save(std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::putText(cv::_InputOutputArray const&, std::string const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::getTextSize(std::string const&, int, double, int, int*)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::FileStorage::FileStorage(std::string const&, int, std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::namedWindow(std::string const&, int)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::FileNode::string() const' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::FileStorage::operator[](std::string const&) const' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::error(int, std::string const&, char const*, char const*, int)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `DBoW2::FORB::toString(cv::Mat const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `pangolin::CreateWindowAndBind(std::string, int, int, pangolin::Params const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::write(cv::FileStorage&, std::string const&, int)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `boost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits<char> >::save(std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `DBoW2::FORB::fromString(cv::Mat&, std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `pangolin::CreatePanel(std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::operator<<(cv::FileStorage&, std::string const&)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `cv::write(cv::FileStorage&, std::string const&, double)' /usr/bin/ld: ../lib/libORB_SLAM3.so: undefined reference to `boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::load(std::string&)' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/mono_inertial_tum_vi_old.dir/build.make:132:../Examples_old/Monocular-Inertial/mono_inertial_tum_vi_old] 错误 1 make[1]: *** [CMakeFiles/Makefile2:120:CMakeFiles/mono_inertial_tum_vi_old.dir/all] 错误 2 make: *** [Makefile:84:all] 错误 2
06-14
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值