ivanenko / cloud_storage

Wfx plugin for Total/Double commander for cloud storages
30 stars 2 forks source link

Cannot compile on Ubunutu 20.04 #12

Open ghost opened 2 years ago

ghost commented 2 years ago

I followed the instructions as per https://github.com/ivanenko/cloud_storage#installation i.e.

sudo apt-get install g++ libssl-dev
git clone https://github.com/ivanenko/cloud_storage.git
cd cloud_storage
mkdir cmake-build-release
cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release . -Bcmake-build-release
cmake --build cmake-build-release --target cloud_storage -- -j 2

I get the following returned and the compiling fails

Consolidate compiler generated dependencies of target cloud_storage
[ 10%] Building CXX object CMakeFiles/cloud_storage.dir/library.cpp.o
[ 20%] Building CXX object CMakeFiles/cloud_storage.dir/plugin_utils.cpp.o
In file included from /home/xxx/Installs/cloud_storage/plugin_utils.h:25,
                 from /home/xxx/Installs/cloud_storage/plugin_utils.cpp:32:
/home/xxx/Installs/cloud_storage/service_clients/service_client.h: In member function ‘virtual const char* service_client_exception::what() const’:
/home/xxx/Installs/cloud_storage/service_clients/service_client.h:50:5: warning: no return statement in function returning non-void [-Wreturn-type]
   50 |     }
      |     ^
/home/xxx/Installs/cloud_storage/service_clients/service_client.h: At global scope:
/home/xxx/Installs/cloud_storage/service_clients/service_client.h:68:19: error: ‘string’ in namespace ‘std::__cxx11’ does not name a type; did you mean ‘to_string’?
   68 |     std::__cxx11::string url_encode(const std::__cxx11::string& s);
      |                   ^~~~~~
      |                   to_string
/home/xxx/Installs/cloud_storage/plugin_utils.cpp: In function ‘nlohmann::json& get_connection_config(nlohmann::json&, std::string&)’:
/home/xxx/Installs/cloud_storage/plugin_utils.cpp:141:12: warning: reference to local variable ‘j_null’ returned [-Wreturn-local-addr]
  141 |     return j_null;
      |            ^~~~~~
/home/xxx/Installs/cloud_storage/plugin_utils.cpp:140:20: note: declared here
  140 |     nlohmann::json j_null(nlohmann::json::value_t::null);
      |                    ^~~~~~
In file included from /home/xxx/Installs/cloud_storage/plugin_utils.h:25,
                 from /home/xxx/Installs/cloud_storage/library.cpp:30:
/home/xxx/Installs/cloud_storage/service_clients/service_client.h: In member function ‘virtual const char* service_client_exception::what() const’:
/home/xxx/Installs/cloud_storage/service_clients/service_client.h:50:5: warning: no return statement in function returning non-void [-Wreturn-type]
   50 |     }
      |     ^
/home/xxx/Installs/cloConsolidate compiler generated dependencies of target cloud_storage
[ 10%] Building CXX object CMakeFiles/cloud_storage.dir/library.cpp.o
[ 20%] Building CXX object CMakeFiles/cloud_storage.dir/plugin_utils.cpp.o
In file included from /home/xxx/Installs/cloud_storage/plugin_utils.h:25,
                 from /home/xxx/Installs/cloud_storage/plugin_utils.cpp:32:
/home/xxx/Installs/cloud_storage/service_clients/service_client.h: In member function ‘virtual const char* service_client_exception::what() const’:
/home/xxx/Installs/cloud_storage/service_clients/service_client.h:50:5: warning: no return statement in function returning non-void [-Wreturn-type]
   50 |     }
      |     ^
/home/xxx/Installs/cloud_storage/service_clients/service_client.h: At global scope:
/home/xxx/Installs/cloud_storage/service_clients/service_client.h:68:19: error: ‘string’ in namespace ‘std::__cxx11’ does not name a type; did you mean ‘to_string’?
   68 |     std::__cxx11::string url_encode(const std::__cxx11::string& s);
      |                   ^~~~~~
      |                   to_string
/home/xxx/Installs/cloud_storage/plugin_utils.cpp: In function ‘nlohmann::json& get_connection_config(nlohmann::json&, std::string&)’:
/home/xxx/Installs/cloud_storage/plugin_utils.cpp:141:12: warning: reference to local variable ‘j_null’ returned [-Wreturn-local-addr]
  141 |     return j_null;
      |            ^~~~~~
/home/xxx/Installs/cloud_storage/plugin_utils.cpp:140:20: note: declared here
  140 |     nlohmann::json j_null(nlohmann::json::value_t::null);
      |                    ^~~~~~
In file included from /home/xxx/Installs/cloud_storage/plugin_utils.h:25,
                 from /home/xxx/Installs/cloud_storage/library.cpp:30:
/home/xxx/Installs/cloud_storage/service_clients/service_client.h: In member function ‘virtual const char* service_client_exception::what() const’:
/home/xxx/Installs/cloud_storage/service_clients/service_client.h:50:5: warning: no return statement in function returning non-void [-Wreturn-type]
   50 |     }
      |     ^
/home/xxx/Installs/cloud_storage/service_clients/service_client.h: At global scope:
/home/xxx/Installs/cloud_storage/service_clients/service_client.h:68:19: error: ‘string’ in namespace ‘std::__cxx11’ does not name a type; did you mean ‘to_string’?
   68 |     std::__cxx11::string url_encode(const std::__cxx11::string& s);
      |                   ^~~~~~
      |                   to_string
gmake[3]: *** [CMakeFiles/cloud_storage.dir/build.make:90: CMakeFiles/cloud_storage.dir/plugin_utils.cpp.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
gmake[3]: *** [CMakeFiles/cloud_storage.dir/build.make:76: CMakeFiles/cloud_storage.dir/library.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:83: CMakeFiles/cloud_storage.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:90: CMakeFiles/cloud_storage.dir/rule] Error 2
gmake: *** [Makefile:124: cloud_storage] Error 2ud_storage/service_clients/service_client.h: At global scope:
/home/xxx/Installs/cloud_storage/service_clients/service_client.h:68:19: error: ‘string’ in namespace ‘std::__cxx11’ does not name a type; did you mean ‘to_string’?
   68 |     std::__cxx11::string url_encode(const std::__cxx11::string& s);
      |                   ^~~~~~
      |                   to_string
gmake[3]: *** [CMakeFiles/cloud_storage.dir/build.make:90: CMakeFiles/cloud_storage.dir/plugin_utils.cpp.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
gmake[3]: *** [CMakeFiles/cloud_storage.dir/build.make:76: CMakeFiles/cloud_storage.dir/library.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:83: CMakeFiles/cloud_storage.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:90: CMakeFiles/cloud_storage.dir/rule] Error 2
gmake: *** [Makefile:124: cloud_storage] Error 2

OS details:

beotiger commented 2 years ago

You can change std::__cxx11::string to std::string and it will build and work as usual.