matteoserva / MegaFuse

MEGA client for linux, based on FUSE
Other
250 stars 80 forks source link

Compilation error on Debian 10 x86 #106

Open ambipur76 opened 4 years ago

ambipur76 commented 4 years ago

After installing the required packages, I get the following error when running make: g++ -I inc -I /usr/include/cryptopp -I sdk -std=c++0x -O0 -g -fstack-protector-all -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include/i386-linux-gnu -I/usr/include/fuse -D_GLIBCXX_DEBUG -c src/MegaFuseApp.cpp -o src/MegaFuseApp.o src/MegaFuseApp.cpp: In member function ‘virtual void MegaFuseApp::nodes_updated(Node*, int)’: src/MegaFuseApp.cpp:66:11: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘handle’ {aka ‘long long unsigned int’} [-Wformat=] printf("file uploaded nodehandle %lx\n",n[i]->nodehandle); ^~~~~~~~ ~~~~ src/MegaFuseApp.cpp:75:11: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘handle’ {aka ‘long long unsigned int’} [-Wformat=] printf("file overwritten. nodehandle %lx\n",n[i]->nodehandle); ^~~~~~~~ ~~~~ src/MegaFuseApp.cpp: In member function ‘virtual void MegaFuseApp::transfer_complete(int, handle, const byte, const byte, SymmCipher)’: src/MegaFuseApp.cpp:238:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘handle’ {aka ‘long long unsigned int’} [-Wformat=] printf("ulhandle %lx, nodehandle %lx\n",ulhandle,newnode->nodehandle); ^~~~~~~~ ~~~~ src/MegaFuseApp.cpp:238:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘handle’ {aka ‘long long unsigned int’} [-Wformat=] src/MegaFuseApp.cpp: In member function ‘virtual void MegaFuseApp::transfer_update(int, m_off_t, m_off_t, dstime)’: src/MegaFuseApp.cpp:360:46: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx1998::vector<bool, std::allocator >::size_type’ {aka ‘unsigned int’} [-Wsign-compare] } else if(endChunk > startChunk && endChunk < it->second.availableChunks.size() && it->second.availableChunks[endChunk]) {


g++ -I inc -I /usr/include/cryptopp -I sdk -std=c++0x -O0 -g -fstack-protector-all -Wall  -D_FILE_OFFSET_BITS=64 -I/usr/include/i386-linux-gnu -I/usr/include/fuse -D_GLIBCXX_DEBUG  -c src/file_cache_row.cpp -o src/file_cache_row.o
src/file_cache_row.cpp: In static member function ‘static int CacheManager::numChunks(size_t)’:
src/file_cache_row.cpp:72:13: error: ‘ceil’ was not declared in this scope
  return 8 + ceil(float(pos-end)/(8.0*ChunkedHash::SEGSIZE));
             ^~~~
src/file_cache_row.cpp:72:13: note: suggested alternative: ‘cend’
  return 8 + ceil(float(pos-end)/(8.0*ChunkedHash::SEGSIZE));
             ^~~~
             cend
make: *** [Makefile:43: src/file_cache_row.o] Error 1

Could you provide a patch or give some support to help me to solve this compilation issue?
ghost commented 4 years ago

edit file src/file_cache_row.cpp and add this row

#include <math.h> 

below #include , for me works. I will make a pull request if is not already exist.

EDIT There is already pull request #96