meganz / MEGAcmd

Command Line Interactive and Scriptable Application to access MEGA
Other
1.92k stars 406 forks source link

error: cannot convert ‘std::string*’ {aka ‘std::__cxx11::basic_string<char>*’} to ‘mega::LocalPath&’ #506

Open roblav96 opened 4 years ago

roblav96 commented 4 years ago

Trying to build MEGAcmd with the latest sdk, I keep getting this error:

make

  CXX      src/mega_cmd_server-configurationmanager.o
src/configurationmanager.cpp: In static member function ‘static void megacmd::ConfigurationManager::loadConfigDir()’:
src/configurationmanager.cpp:136:71: error: cannot convert ‘std::string*’ {aka ‘std::__cxx11::basic_string<char>*’} to ‘mega::LocalPath&’
  136 |     if (!is_file_exist(configFolder.c_str()) && !fsAccess->mkdirlocal(&localConfigFolder, true))
      |                                                                       ^~~~~~~~~~~~~~~~~~
      |                                                                       |
      |                                                                       std::string* {aka std::__cxx11::basic_string<char>*}
In file included from ./sdk/include/mega.h:77,
                 from ./sdk/include/megaapi_impl.h:28,
                 from src/megacmd.h:41,
                 from src/configurationmanager.h:22,
                 from src/configurationmanager.cpp:19:
./sdk/include/mega/posix/megafs.h:106:21: note:   initializing argument 1 of ‘virtual bool mega::PosixFileSystemAccess::mkdirlocal(mega::LocalPath&, bool)’
  106 |     bool mkdirlocal(LocalPath&, bool) override;
      |                     ^~~~~~~~~~
make[2]: *** [Makefile:1173: src/mega_cmd_server-configurationmanager.o] Error 1

./configure

configure: Configured to build Mega SDK:

  SDK version:      3.7.3
  Host setup:       x86_64-pc-linux-gnu
  Install prefix:   /home/ubuntu/.playground/MEGAcmd/usr/local
  Compiler:         g++
  CXXFLAGS:         -g -O2 -DNDEBUG=1 -fPIC
  LDFLAGS:          -lstdc++fs -lrt -pthread
  gcc hardening:    no
  debug:            no
  static:           no
  sync subsystem:   yes
  chat:             no
  MEGA API          yes
  example apps:     yes

  inotify:          yes
  posix threads:    yes

  Python bindings:  no
  Python3 bindings: no
  PHP bindings:     no
  SWIG_FLAGS_PHP:

  Java bindings:    no

  OpenSSL:            -lssl -lcrypto
  Crypto++:           -lcryptopp
  Sodium:             -lsodium
  Zlib:               -lz
  SQLite3:            -lsqlite3
  c-ares:             -lcares
  cURL:              -lcurl
  FreeImage:          -lfreeimage
  Readline:           -lreadline
  Termcap:            -ltermcap
  PCRE:
  LIBUV:              -luv
  LIBRAW:              -lraw -fopenmp
  LIBMEDIAINFO:       -DUNICODE -lmediainfo -lzen -pthread
  FFMPEG:             -lavcodec -lavformat -lavutil -lswscale

configure: MEGAcmd configuration:

  MEGACMD version:      1.3.0
  Install prefix:   /home/ubuntu/.playground/MEGAcmd/usr/local
  Compiler:         g++
  CXXFLAGS:         -g -O2 -DNDEBUG=1 -fPIC -DENABLE_BACKUPS=1
  CPPFLAGS:
  LDFLAGS:          -pthread
  debug:            no
  static:           no
  posix threads:    yes

  Readline:           -lreadline
  Termcap:            -ltermcap
  PCRE:               -lpcrecpp -lpcre
  SDK includes:     -I. -I./include -I./include/mega -I./include/mega/posix -I./third_party/utf8proc
sergiohs84 commented 3 years ago

Hi @roblav96

We have updated the codebase and now mklocaldir() accepts a LocalPath as argument, not a std::string. That's why you get the compiler error.

Could you please provide the commits of MEGAcmd and MEGA's SDK that produce such compilation error? I think it's already solved in recent code.

Thanks