boost-system

Compare boost::system::error_category

爱⌒轻易说出口 提交于 2020-01-24 20:59:46
问题 The following comparison fails for an error whom outputs "asio.misc" for errorCode.category().name() and "end of file" for errorCode.message() If it claims to be in category asio.misc, then why does the if condition of (errorCode.category() == boost::asio::error::misc_category ) evaluate to false? Googling (including answers here) says that a boost::system::error_code can have the same value in more than one category, so I assume that in order to get the proper message and meaning we must

Undefined reference to boost::system::generic_category despite linking with boost_system [duplicate]

元气小坏坏 提交于 2019-12-24 02:30:33
问题 This question already has answers here : What is an undefined reference/unresolved external symbol error and how do I fix it? (32 answers) Closed 4 years ago . My compilation command is: g++ -I/home/foo/boost_1_56_0 -L/home/foo/boost_1_56_0/stage/lib -lboost_system -lboost_filesystem -lpthread -lboost_thread -lboost_system -lboost_filesystem -lpthread -lboost_thread main.cpp foo.cpp I get an undefined reference to boost::system::generic_category error despite the fact that I link it with

How to get boost::system::error_code::message in English?

懵懂的女人 提交于 2019-12-22 04:43:12
问题 On Win7 having localized UI, error_code::message() returns a non-English message. As far as I see (in Boost 1.54, for system_error_category ), the above function boils down to the following WinAPI call: DWORD retval = ::FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, ev, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPSTR) &lpMsgBuf, 0, NULL ); How to get the above FormatMessage to return an English message?

How to get boost::system::error_code::message in English?

不想你离开。 提交于 2019-12-22 04:43:06
问题 On Win7 having localized UI, error_code::message() returns a non-English message. As far as I see (in Boost 1.54, for system_error_category ), the above function boils down to the following WinAPI call: DWORD retval = ::FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, ev, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPSTR) &lpMsgBuf, 0, NULL ); How to get the above FormatMessage to return an English message?

Boost system 1.69.0 not header only?

末鹿安然 提交于 2019-12-11 06:08:13
问题 Boost system is a header only library since 1.69.0. However, linking against libboost_filesystem.so.1.69.0 gives these linker errors: ld: libboost_system.so.1.69.0, needed by libboost_filesystem.so.1.69.0, not found (try using -rpath or -rpath-link) which suggest that I still need to link against libboost_system.so , even though it is supposedly header only. Do I need to set some special flags when building Boost itself to get a truly header only system library? 回答1: Boost system is now

How to get boost::system::error_code::message in English?

亡梦爱人 提交于 2019-12-05 05:38:39
On Win7 having localized UI, error_code::message() returns a non-English message. As far as I see (in Boost 1.54, for system_error_category ), the above function boils down to the following WinAPI call: DWORD retval = ::FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, ev, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPSTR) &lpMsgBuf, 0, NULL ); How to get the above FormatMessage to return an English message? I tried to set the locale, both with std functions and with SetThreadLocale - it didn't help. Update :

Which Boost error codes/conditions are returned by which Boost.Asio calls?

℡╲_俬逩灬. 提交于 2019-12-01 09:45:21
问题 I am currently writing a TCP I/O facility that uses Boost.Asio as the underlying socket API, and I've noticed that Boost.Asio seems to lack documentation on which specific Boost error codes/conditions can result from each individual operation (e.g. function/method call or asynchronous operation). All that I've been able to find is the error code API and some informal error code lists, none of which correlate specific codes to specific operations . This apparent lack of documentation is

Which Boost error codes/conditions are returned by which Boost.Asio calls?

 ̄綄美尐妖づ 提交于 2019-12-01 09:44:07
I am currently writing a TCP I/O facility that uses Boost.Asio as the underlying socket API, and I've noticed that Boost.Asio seems to lack documentation on which specific Boost error codes/conditions can result from each individual operation (e.g. function/method call or asynchronous operation). All that I've been able to find is the error code API and some informal error code lists, none of which correlate specific codes to specific operations . This apparent lack of documentation is frustrating, because it's difficult to write robust code when you don't know the possible failure modes. It's