boost

Not able to archive all the data

荒凉一梦 提交于 2020-06-17 09:58:13
问题 I am using boost for serialization of data. This is how the classes are structured. 1) I have a Stage class This class holds vector data for the director class class Stage { public: std::vector<Director> directors; void AddDirector(Director dir) { directors.push_back(dir); } int GetDirectorSize() { return directors.size(); } Director* GetDirector(int number) { return &directors[number]; } private: friend class boost::serialization::access; template<typename Archive> void save(Archive& ar,

How to pass a boost asio tcp socket to a thread for sending heartbeat to client or server

|▌冷眼眸甩不掉的悲伤 提交于 2020-06-16 23:43:34
问题 I am writing a client/server program in boost TCP in which I want to send a HEARTBEAT message to the client every 2 seconds for which I am trying to create a new thread by which I can send it easily but unable to solve it. I am creating thread using boost::thread t(hearbeatSender,sock); this. but giving lots of errors. I also use bind to bind function name with the socket but not resolved the error. void process(boost::asio::ip::tcp::socket & sock); std::string read_data(boost::asio::ip::tcp:

Boost: How bjam constructs a library name?

偶尔善良 提交于 2020-06-09 16:33:29
问题 I was looking in the jam files, how the name of library is constructed. Example: libboost_log-mgw46-mt-1_48.dll I would like to ignore the last part, how to pass linker the -o parameter with my constructed name. I have few versions and linking in a big project forces me to do changes in project file and that is a lot of places. My wish is to get libboost_log.dll. I did just rename, but when executing a program it says, that it can not find libboost_log-mgw46-mt-1_48.dll file. 回答1: Boost Bjam

Boost: How bjam constructs a library name?

拥有回忆 提交于 2020-06-09 16:31:20
问题 I was looking in the jam files, how the name of library is constructed. Example: libboost_log-mgw46-mt-1_48.dll I would like to ignore the last part, how to pass linker the -o parameter with my constructed name. I have few versions and linking in a big project forces me to do changes in project file and that is a lot of places. My wish is to get libboost_log.dll. I did just rename, but when executing a program it says, that it can not find libboost_log-mgw46-mt-1_48.dll file. 回答1: Boost Bjam

Boost: How bjam constructs a library name?

不羁岁月 提交于 2020-06-09 16:28:25
问题 I was looking in the jam files, how the name of library is constructed. Example: libboost_log-mgw46-mt-1_48.dll I would like to ignore the last part, how to pass linker the -o parameter with my constructed name. I have few versions and linking in a big project forces me to do changes in project file and that is a lot of places. My wish is to get libboost_log.dll. I did just rename, but when executing a program it says, that it can not find libboost_log-mgw46-mt-1_48.dll file. 回答1: Boost Bjam

How to fix error LNK2001 & LNK2019

﹥>﹥吖頭↗ 提交于 2020-06-02 08:08:29
问题 ProjectAAA.obj : error LNK2001: unresolved external symbol "public: __thiscall X::ClassEvent::ClassEvent(unsigned int)" (??0ClassEvent@X@@QAE@I@Z) boost::shared_ptr<ClassEvent> bcfEvent(new ClassEvent((unsigned int) 10)); I have defined ClassEvent::ClassEvent(unsigned int) and have no idea how to fix this LINK errors. Any suggestion is appreciated. Thank you MORE INFO: 1>ProjectAAA.obj : error LNK2019: unresolved external symbol "public: __thiscall APP::X::ClassEvent::ClassEvent(unsigned int)

Is it possible to do async_handshake after reading from socket prior using Boost::asio?

我是研究僧i 提交于 2020-06-01 17:14:13
问题 I have a boost::asio::ssl::stream<boost::asio::ip::tcp::socket> typed socket. When boost first accepts a connection to this socket, I want to peek at some bytes. However, peeking is not something you can do properly/safely. So I read the bytes I need and have them in a buffer. typedef socket_type boost::asio::ssl::stream<boost::asio::ip::tcp::socket>; void OnAccept(std::shared_ptr<socket_type> socket) { boost::asio::mutable_buffers_1 sslBuffer(m_Buffer.data(), m_Buffer.size()); // I'm going

Is it possible to do async_handshake after reading from socket prior using Boost::asio?

孤街浪徒 提交于 2020-06-01 17:09:40
问题 I have a boost::asio::ssl::stream<boost::asio::ip::tcp::socket> typed socket. When boost first accepts a connection to this socket, I want to peek at some bytes. However, peeking is not something you can do properly/safely. So I read the bytes I need and have them in a buffer. typedef socket_type boost::asio::ssl::stream<boost::asio::ip::tcp::socket>; void OnAccept(std::shared_ptr<socket_type> socket) { boost::asio::mutable_buffers_1 sslBuffer(m_Buffer.data(), m_Buffer.size()); // I'm going

add File, Function, Line to global boost logger

∥☆過路亽.° 提交于 2020-06-01 13:12:50
问题 I have working boost log code, but want to append File, Function, and Line to every log call. Here is my code: logging.hpp #ifndef LOGGING_HPP #define LOGGING_HPP #include <boost/log/expressions.hpp> #include <boost/log/sources/global_logger_storage.hpp> #include <boost/log/support/date_time.hpp> #include <boost/log/trivial.hpp> #include <boost/log/utility/setup.hpp> #define INFO BOOST_LOG_SEV(my_logger::get(), boost::log::trivial::info) #define WARN BOOST_LOG_SEV(my_logger::get(), boost::log

CMake FindPackage fails for custom built boost libraries

瘦欲@ 提交于 2020-06-01 07:14:42
问题 I am trying to build a native Android project that requires Boost library. I have built Boost for the platforms I am targeting using this git project. But for some reason find_package() for Boost fails to find the Boost header paths Below is the project structure and for the Android app, and location where I have placed the Boost library. android_app ├── src │ └──<folder> │ └──<folder> │ └──CMakeLists.txt └── lib └── boost_armeabi-v7a ├── include │ └── boost_1_68_0 │ └──boost │ ├──align.hpp │