Infactum / tg2sip

Telegram <-> SIP voice gateway
GNU General Public License v2.0
273 stars 104 forks source link

Compilation error: gcc-10.x #50

Open sergei-mironov opened 2 years ago

sergei-mironov commented 2 years ago

Hi, I have a problem compiling tg2sip with gcc10x. Older gcc9x seems to work fine.

The gcc10x errors are as follows:

[ 99%] Building CXX object CMakeFiles/tg2sip.dir/tg2sip/utils.cpp.o                                                                                                                                                                                  
In file included from /build/tg2sip-1.2.0/tg2sip/gateway.h:24,                                                                                                                                                                                       
                 from /build/tg2sip-1.2.0/tg2sip/gateway.cpp:19:                                                                                                                                                                                     
/build/tg2sip-1.2.0/include/boost/sml.hpp:2528:8: warning: undefining "__has_builtin"                                                                                                                                                                
 2528 | #undef __has_builtin                                                                                                                                                                                                                         
      |        ^~~~~~~~~~~~~                                                                                                                                                                                                                         
In file included from /build/tg2sip-1.2.0/tg2sip/gateway.h:24,                                                                                                                                                                                       
                 from /build/tg2sip-1.2.0/tg2sip/main.cpp:27:                                                                                                                                                                                        
/build/tg2sip-1.2.0/include/boost/sml.hpp:2528:8: warning: undefining "__has_builtin"                                                                                                                                                                
 2528 | #undef __has_builtin                                                                                                                                                                                                                         
      |        ^~~~~~~~~~~~~                                                                                                                                                                                                                         
/build/tg2sip-1.2.0/tg2sip/utils.cpp: In function 'bool is_digits(const string&)':                                                                                                                                                                   
/build/tg2sip-1.2.0/tg2sip/utils.cpp:21:61: error: invalid use of incomplete type 'const string' {aka 'const class std::__cxx11::basic_string<char>'}                                                                                                
   21 | bool is_digits(const std::string &str) { return std::all_of(str.begin(), str.end(), ::isdigit); };                                                                                                                                           
      |                                                             ^~~                                                                                                                                                                              
In file included from /nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/iosfwd:39,                                                                                                                                           
                 from /nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/memory:74,                                                                                                                                           
                 from /build/tg2sip-1.2.0/tg2sip/utils.h:21,                                                                                                                                                                                         
                 from /build/tg2sip-1.2.0/tg2sip/utils.cpp:19:                                                                                                                                                                                       
/nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/bits/stringfwd.h:74:11: note: declaration of 'std::string' {aka 'class std::__cxx11::basic_string<char>'}                                                                  
   74 |     class basic_string;                                                                                                                                                                                                                      
      |           ^~~~~~~~~~~~                                                                                                                                                                                                                       
/build/tg2sip-1.2.0/tg2sip/utils.cpp:21:74: error: invalid use of incomplete type 'const string' {aka 'const class std::__cxx11::basic_string<char>'}                                                                                                
   21 | bool is_digits(const std::string &str) { return std::all_of(str.begin(), str.end(), ::isdigit); };                                                                                                                                           
      |                                                                          ^~~                                                                                                                                                                 
In file included from /nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/iosfwd:39,                                                                                                                                           
                 from /nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/memory:74,                                                                                                                                           
                 from /build/tg2sip-1.2.0/tg2sip/utils.h:21,                                                                                                                                                                                         
                 from /build/tg2sip-1.2.0/tg2sip/utils.cpp:19:                                                                                                                                                                                       
/nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/bits/stringfwd.h:74:11: note: declaration of 'std::string' {aka 'class std::__cxx11::basic_string<char>'}                                                                  
   74 |     class basic_string;                                                                                                                                                                                                                      
      |           ^~~~~~~~~~~~                                                                                                                                                                                                                       
/build/tg2sip-1.2.0/tg2sip/utils.cpp:21:87: error: '::isdigit' has not been declared; did you mean 'is_digits'?                                                                                                                                      
   21 | bool is_digits(const std::string &str) { return std::all_of(str.begin(), str.end(), ::isdigit); };                                                                                                                                           
      |                                                                                       ^~~~~~~                                                                                                                                                
      |                                                                                       is_digits 
varlog11 commented 2 years ago

Hi, I have a same problem compiling tg2sip v1.3.0

boffart commented 1 year ago

Тоже с этим столкнулся.

Нужно добавить #include <string> в https://github.com/Infactum/tg2sip/blob/master/tg2sip/utils.cpp#L20