Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: no viable conversion from returned value of type 'int' to function return type 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') #100

Open
yurivict opened this issue Jun 12, 2023 · 0 comments

Comments

@yurivict
Copy link

Build fails:

/usr/ports/biology/btllib/work/btllib-1.6.0/src/btllib/status.cpp:92:10: error: no viable conversion from returned value of type 'int' to function return type 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>')
  return strerror_r(errno, buf, buflen);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/string:823:35: note: candidate constructor not viable: no known conversion from 'int' to 'const std::string &' for 1st argument
    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string(const basic_string& __str);
                                  ^
/usr/include/c++/v1/string:828:5: note: candidate constructor not viable: no known conversion from 'int' to 'std::string &&' for 1st argument
    basic_string(basic_string&& __str)
    ^
/usr/include/c++/v1/string:841:5: note: candidate constructor template not viable: no known conversion from 'int' to 'const char *' for 1st argument
    basic_string(const _CharT* __s) : __r_(__default_init_tag(), __default_init_tag()) {
    ^
/usr/include/c++/v1/string:895:5: note: candidate constructor not viable: no known conversion from 'int' to 'initializer_list<char>' for 1st argument
    basic_string(initializer_list<_CharT> __il);
    ^
/usr/include/c++/v1/string:816:66: note: explicit constructor is not a candidate
    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit basic_string(const allocator_type& __a)
                                                                 ^
/usr/include/c++/v1/string:881:18: note: explicit constructor is not a candidate
        explicit basic_string(const _Tp& __t);
                 ^
1 error generated.

Version: 1.6.0
clang-15
FreeBSD 13.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant