Menu

compiling with GCC 6.3.1, ERANGE’ was not declared in this scope

2017-05-01
2017-05-01
  • Patrick C. F. Ernzer

    When I try to compile with GCC 6.3.1, I get;

    $ make
    cc  -c HarmonyHubControl.cpp csocket.cpp -lstdc++ 
    HarmonyHubControl.cpp: In function ‘int swapAuthorizationToken(csocket*, std::__cxx11::string&)’:
    HarmonyHubControl.cpp:373:28: warning: overflow in implicit constant conversion [-Woverflow]
         int pos = std::string::npos;
                                ^~~~
    In file included from /usr/include/c++/6.3.1/bits/basic_string.h:5402:0,
                     from /usr/include/c++/6.3.1/string:52,
                     from csocket.h:15,
                     from csocket.cpp:1:
    /usr/include/c++/6.3.1/ext/string_conversions.h: In function ‘_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...)’:
    /usr/include/c++/6.3.1/ext/string_conversions.h:72:25: error: ‘ERANGE’ was not declared in this scope
           else if (errno == ERANGE
                             ^~~~~~
    Makefile:7: recipe for target 'HarmonyHubControl.o' failed
    make: *** [HarmonyHubControl.o] Error 1
    

    pcfe

     
  • Patrick C. F. Ernzer

    FWIW, with compat-gcc-34-c++ it does build.

    $ CC=/usr/bin/gcc34 make
    /usr/bin/gcc34  -c HarmonyHubControl.cpp csocket.cpp -lstdc++ 
    gcc34: -lstdc++: linker input file unused because linking not done
    /usr/bin/gcc34  HarmonyHubControl.o csocket.o -o HarmonyHubControl -lstdc++
    

    I get an executable even though the linker input file was not used.

    list_devices and list_commands work seemingly fine, list_activities only shows
    -1 - PowerOff

     

    Last edit: Patrick C. F. Ernzer 2017-05-01

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.