aliyun / alibabacloud-cpp-sdk

9 stars 7 forks source link

dysmsapi compilation error #5

Open linhuifj opened 3 years ago

linhuifj commented 3 years ago

-- alibabacloud_dysmsapi_20170525 : Project will be installed to /usr/local -- Installing LIB components to /usr/local/lib -- Installing BIN components to /usr/local/bin -- Installing INCLUDE components to /usr/local/include -- Installing CMAKE components to /usr/local/share/cmake/darabonba_util -- Configuring done -- Generating done -- Build files have been written to: /opt/alibaba/dysmsapi-20170525/cmake_build [ 9%] Built target alibabacloud_endpoint_util [ 36%] Built target darabonba_core [ 59%] Built target darabonba_util [ 68%] Built target alibabacloud_open_api_util [ 81%] Built target alibabacloud_credential [ 90%] Built target alibabacloud_open_api Scanning dependencies of target alibabacloud_dysmsapi_20170525 [ 95%] Building CXX object CMakeFiles/alibabacloud_dysmsapi_20170525.dir/src/dysmsapi_20170525.cpp.o /opt/alibaba/dysmsapi-20170525/src/dysmsapi_20170525.cpp: In member function ‘std::cxx11::string Alibabacloud_Dysmsapi20170525::Client::getEndpoint(std::shared_ptr<std::cxx11::basic_string >, std::shared_ptr<std::cxx11::basic_string >, std::shared_ptr<std::cxx11::basic_string >, std::shared_ptr<std::cxx11::basic_string >, std::shared_ptr<std::cxx11::basic_string >, std::shared_ptr<std::map<std::cxx11::basic_string, std::cxx11::basic_string > >, std::shared_ptr<std::cxx11::basic_string >)’: /opt/alibaba/dysmsapi-20170525/src/dysmsapi_20170525.cpp:41:142: error: no match for ‘operator[]’ (operand types are ‘std::shared_ptr_access<std::map<std::cxx11::basic_string, std::cxx11::basic_string >, (gnu_cxx::_Lock_policy)2, false, false>::element_type’ {aka ‘std::map<std::cxx11::basic_string, std::cxx11::basic_string >’} and ‘std::shared_ptr<std::cxx11::basic_string >’) Darabonba_Util::Client::isUnset<map<string, string>>(endpointMap) && !Darabonba_Util::Client::empty(make_shared((*endpointMap)[regionId]))) {

linhuifj commented 3 years ago

the code may need to be modified as:

string s = *regionId;

if (!Darabonba_Util::Client::isUnset<map<string, string>>(endpointMap) && !Darabonba_Util::Client::empty(make_shared((endpointMap)[s])\ )) { return (endpointMap)[s]; }