Questions tagged [boost-system]

20 questions
9
votes
2 answers

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

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( …
Igor R.
  • 14,716
  • 2
  • 49
  • 83
7
votes
1 answer

What is the encoding used by boost-asio error messages?

I am using boost-asio and I want to process correctly the error message. In this example, I made a typo (1278 instead of 127): boost::system::error_code ec; auto address=boost::asio::ip::address::from_string("1278.0.0.1",ec); if(ec) { auto…
Arnaud
  • 3,765
  • 3
  • 39
  • 69
3
votes
1 answer

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

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.…
HunterZ
  • 181
  • 14
2
votes
1 answer

Compare boost::system::error_category

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() ==…
Christopher Pisz
  • 3,757
  • 4
  • 29
  • 65
2
votes
1 answer

boost system make_error_code of type errc::timed_out has message of "Unkown error"

Why does the following code output "Unknown error"? I expect some other message like "operation timed out" or other descriptive error. OS: Windows 7 boost: 1.57 #include #include "boost/system/system_error.hpp" void main() { …
klmurphy72
  • 21
  • 4
2
votes
1 answer

Boost 1.57 filesystem/system linker error with gcc 4.9.2

I am building an api library and use it as shared for the unittest project. The api is doing some calls the following way #include void LoadResources(const std::string& dataPath) { boost::filesystem::path path(dataPath); …
kittikun
  • 1,829
  • 1
  • 25
  • 33
2
votes
1 answer

Undefined reference to boost::system::generic_category despite linking with boost_system

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…
batman
  • 5,022
  • 11
  • 52
  • 82
1
vote
1 answer

How to use the 1st argument of the boost::asio::signal_set::async_wait's handler?

void handler(boost::system::error_code const& e, int s) { if (!e) { /* I see it */ } else { /* but I don't understand which situations the case occurs in. */ } } What errors can generally happen in an application for the case? Thanks for your…
1
vote
1 answer

Boost system 1.69.0 not header only?

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…
Ton van den Heuvel
  • 10,157
  • 6
  • 43
  • 82
1
vote
1 answer

Undefined symbol boost::system:detail::system_category_instance

I've build boost with c++17 standard with clang on macOS Mojave when compiling my playground program that uses beast and asio I get the following error: This is my make file: cmake_minimum_required (VERSION 3.13.1) project…
Fabian
  • 492
  • 6
  • 20
1
vote
1 answer

How do I link Linux libraries for a cross-platform Linux project in Visual Studio 2017?

I am on Windows and using a cross-platform project building for Linux in Visual Studio 2017 Community. I am trying to build my project but for some reason a library isn't being detected, or used correctly. 1>Linking…
jjmcc
  • 795
  • 2
  • 11
  • 27
1
vote
1 answer

Runtime error using boost - undefined symbol: _ZN5boost6system15system_categoryEv

I am compiling a simple project (shared library) using CMake, this is the content of the CMakeLists.txt set (CMAKE_BUILD_TYPE Release) set (LibName test) cmake_minimum_required(VERSION 2.8 FATAL_ERROR) project(test CXX) set(CMAKE_CXX_FLAGS…
1
vote
0 answers

Boost 1.44 asio linker problems with visual studio

I'm trying to build a project that needs Boost 1.44.0 in Visual Studio 2005 (I know it's old but I have to use these versions). I already have build it with bjam as it mention here with the following line in VS 2005 Command Prompt: bjam…
0
votes
0 answers

Boost 1.81.0 (chrono and thread) library compilation is failing with Sun Studio 12.5

Facing below error when i am compiling chrono or thread alone in sun studio 12.5 Error I am getting while build boost thread/ chrono is below "CC" -std=c++11 -m64 -xarch=sparc -mt -lCstd -xO4 -mt -erroff=%none -xldscope=hidden -m64…
0
votes
0 answers

Bad File Descriptor error when running boost::process::system

When running following code, I get an error in XCode output saying nw_path_close_fd Failed to close guarded necp fd 47 [9: Bad file descriptor] Code: #include int main() { boost::process::ipstream outStream; …
sajas
  • 1,599
  • 1
  • 17
  • 39
1
2