bcgsc / btllib

Bioinformatics Technology Lab common code library
Other
23 stars 5 forks source link

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 1 year ago

yurivict commented 1 year ago

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