libQtShadowsocks icon indicating copy to clipboard operation
libQtShadowsocks copied to clipboard

make error on ubuntu18.04, arm64

Open reso1 opened this issue 6 years ago • 0 comments

Platform: Ubuntu18.04 on arm64

The former instructions of the building procedure is OKAY for me:

$ mkdir build && cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr

But then when I use make -j4, problems occured as followed:

/home/tpp/Downloads/libQtShadowsocks-2.1.0/lib/crypto/cipher.cpp: In member function ‘std::__cxx11::string QSS::Cipher::update(const uint8_t*, size_t)’: /home/tpp/Downloads/libQtShadowsocks-2.1.0/lib/crypto/cipher.cpp:156:83: error: invalid cast from type ‘std::vector<unsigned char, Botan::secure_allocator >::iterator {aka __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, Botan::secure_allocator > >}’ to type ‘const char*’ return std::string(reinterpret_cast<const char >(DataOfSecureByteArray(c)), ^ /home/tpp/Downloads/libQtShadowsocks-2.1.0/lib/crypto/cipher.cpp: In static member function ‘static std::__cxx11::string QSS::Cipher::randomIv(int)’: /home/tpp/Downloads/libQtShadowsocks-2.1.0/lib/crypto/cipher.cpp:179:81: error: invalid cast from type ‘std::vector<unsigned char, Botan::secure_allocator >::iterator {aka __gnu_cxx::__normal_iterator<unsigned char, std::vector<unsigned char, Botan::secure_allocator > >}’ to type ‘const char*’ return std::string(reinterpret_cast<const char >(DataOfSecureByteArray(out)), out.size()); ^ /home/tpp/Downloads/libQtShadowsocks-2.1.0/lib/crypto/cipher.cpp: In static member function ‘static std::__cxx11::string QSS::Cipher::md5Hash(const string&)’: /home/tpp/Downloads/libQtShadowsocks-2.1.0/lib/crypto/cipher.cpp:195:83: error: invalid cast from type ‘std::vector<unsigned char, Botan::secure_allocator >::iterator {aka __gnu_cxx::__normal_iterator<unsigned char, std::vector<unsigned char, Botan::secure_allocator > >}’ to type ‘const char*’ return std::string(reinterpret_cast<const char*>(DataOfSecureByteArray(result)), result.size());

Seems like my gcc compiler considers this cast as invalid:

‘std::vector<unsigned char, Botan::secure_allocator >::iterator {aka __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, Botan::secure_allocator > >}’ to type ‘const char*’

Can someone help me?

reso1 avatar Jul 11 '19 02:07 reso1