What is boost system error_code number 2

杀马特。学长 韩版系。学妹 提交于 2021-02-08 06:48:51

问题


I am trying to figure out what boost system error code 2 is. Within a program they print out the boost error code. However, I am not sure how to look up this error code.

Any help would be apprecaited.


回答1:


Off the top of my head: ENOENT/FileNotFound

See the errorcodes in http://www.boost.org/doc/libs/1_58_0/libs/system/doc/reference.html#Header-error_code

Live On Coliru

#include <boost/system/error_code.hpp>
#include <iostream>

int main()
{
    boost::system::error_code ec;

    ec.assign(2, boost::system::system_category());
    std::cout << ec.message() << "\n";

    ec.assign(boost::system::errc::no_such_file_or_directory, boost::system::system_category());
    std::cout << ec.message() << "\n";
}

Prints

No such file or directory
No such file or directory



回答2:


For windows it is ERROR_FILE_NOT_FOUND

Check the reference



来源:https://stackoverflow.com/questions/29782429/what-is-boost-system-error-code-number-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!