Giter Club home page Giter Club logo

cos-cpp-sdk-v5's Introduction

下载与安装

编译选项

根目录下的CMakeLists.txt可以配置编译选项,有如下编译选项:

option(BUILD_UNITTEST "Build unittest" OFF) #配置编译单元测试
option(BUILD_DEMO "Build demo" ON) #配置编译demo测试代码
option(BUILD_SHARED_LIB "Build shared library" OFF) #配置编译动态库

库依赖

依赖动态库:poco、openssl。

SDK 需要自行基于源码重新编译

下载 XML C++ SDK 源码

使用时请将对应系统的库文件以及sdk include头文件拷贝至您的工程中。

third-party目录下有第三方依赖库

third_party/lib/linux/poco/ #linux下依赖的poco动态库,poco库是基于OpenSSL 1.0.2版本编译的,如果客户编译环境的openssl版本不同,需要重新编译poco
third_party/lib/Win32/openssl/ #Win32依赖的openssl库
third_party/lib/Win32/poco/ #Win32依赖的poco库
third_party/lib/x64/openssl/ #Win64依赖的openssl库
third_party/lib/x64/poco/ #Win64依赖的poco库
third_party/lib/macOS/poco/ #macOS依赖的poco库

使用时也请将对应系统的依赖库拷贝至您的工程中。

编译 Linux 版本 SDK

1. 安装编译工具及依赖库

yum install -y gcc gcc-c++ make cmake openssl
#cmake版本要求大于2.8

2. 编译SDK

下载 XML C++ SDK 源码 到您的开发环境,并执行以下命令:

cd ${cos-cpp-sdk} 
mkdir -p build 
cd build 
cmake .. 
make

3. 安装Poco 库

cd ${cos-cpp-sdk} 
sh install-libpoco.sh

该脚本将Poco动态库安装到/usr/lib64目录中,并创建软链接,如果要在生产环境中使用cos sdk,也需要安装Poco库到生产环境中。

4. 测试demo

如果不需要测试demo,可跳过此步骤。

cd ${cos-cpp-sdk} 
vim demo/cos_demo.cpp  #修改demo中的存储桶名以及测试代码
vim CMakeLists.txt #修改根目录下的CMakeLists.txt中的BUILD_DEMO为ON,开启编译demo
cd build && make #编译demo
ls bin/cos_demo #生成的可执行文件在bin目录
vim bin/config.json #修改密钥和园区
./bin/cos_demo #运行demon

5. 使用SDK

编译生成的库文件在build/lib目录中,静态库名称为libcossdk.a, 动态库名称为libcossdk-shared.so。使用时请将库拷贝至您的工程中,同时将include目录拷贝至您的工程中的 include 路径下。

编译 Windows 版本 SDK

1. 安装 visual studio 2017

安装 visual studio 2017 开发环境。

2. 安装 CMake 工具

CMake官网 下载 Windows 版本的 CMake 编译工具,并将 ${CMake的安装路径}\bin,配置在 Windows 的系统环境变量 Path 中。

3. 编译SDK

i. 下载 XML C++ SDK 源码 到您的开发环境。

ii. 打开 Windows 的命令行,cd 到 C++ SDK 的源码目录下,执行命令

mkdir build
cd build
cmake .. #生成Win32 makefile
cmake -G "Visual Studio 15 Win64" .. #生成Win64 makefile

iii. 使用 visual studio 2017 打开解决方案,进行编译。

4. 测试demo

如果不需要测试demo,可跳过此步骤。

修改demo代码,并编译,生成的cos_demo.exe在bin目录中,修改bin/config.json可运行cos_demo.exe。

5. 使用SDK

编译生成的库文件在build/Release目录中,静态库名称为cossdk.lib。使用时请将库拷贝至您的工程中,同时将include目录拷贝至您的工程中的 include 路径下。

编译 Mac 版本 SDK

1. 安装编译工具及依赖库

brew install gcc make cmake openssl

2. 编译SDK

下载 XML C++ SDK 源码 到您的开发环境,并执行以下命令:

cd ${cos-cpp-sdk} 
mkdir -p build 
cd build 
cmake .. 
make

3. 安装Poco 库

Poco库在third_party/lib/macOS/poco目录下,请自行安装。

4. 测试demo

如果不需要测试demo,可跳过此步骤。

修改demo代码,并编译,生成的cos_demo在bin目录中,修改bin/config.json可运行cos_demo。

5. 使用SDK

编译生成的库文件在build/lib目录中,静态库名称为libcossdk.a, 动态库名称为libcossdk-shared.dylib。使用时请将库拷贝至您的工程中,同时将include目录拷贝至您的工程中的 include 路径下。

常见编译问题

  1. 编译可执行程序的时候提示错误:

    PocoCrypto.so.64: undefined reference to [email protected]' libPocoNetSSL.so.64: undefined reference to [email protected]' ibPocoCrypto.so.64: undefined reference to ECDSA_sign@OPENSSL_1.0.1_EC' libPocoCrypto.so.64: undefined reference to [email protected]' ibPocoCrypto.so.64: undefined reference to [email protected]' libPocoNetSSL.so.64: undefined reference to [email protected]' libPocoNetSSL.so.64: undefined reference to [email protected]' libPocoCrypto.so.64: undefined reference to [email protected]' libPocoCrypto.so.64: undefined reference to `[email protected]'

    这种情况一般是工程里自带的poco库的编译依赖的ssl版本与客户机器上的版本不一致导致的,需要用户重新编译poco库,并替换掉third_party里的poco库。

wget https://github.com/pocoproject/poco/archive/refs/tags/poco-1.9.4-release.zip
cd poco-poco-1.9.4-release/
./configure --omit=Data/ODBC,Data/MySQL
mkdir my_build
cd my_build
cmake .. 
make -j5
  1. 编译poco库的时候无法编译出PocoNetSSL库,一般是因为机器没装openssl-devel库
yum install -y openssl-devel
  1. 编译可执行程序的时候提示错误:

    undefined reference to `qcloud_cos::CosConfig::CosConfig(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)

    这种情况一般是因为工程自带的libcossdk.a编译使用的gcc版本与客户机器上的gcc版本不一致导致的,需要客户重新编译poco库和libcossdk。

开始使用

下面为您介绍如何使用 COS C++ SDK 完成一个基础操作,如初始化客户端、创建存储桶、查询存储桶列表、上传对象、查询对象列表、下载对象和删除对象。

? 关于文章中出现的 SecretId、SecretKey、Bucket 等名称的含义和获取方式请参见 COS 术语信息

初始化

配置文件各字段介绍:

"SecretId":"********************************",  // sercret_id替换为用户的 SecretId,登录访问管理控制台查看密钥,https://console.cloud.tencent.com/cam/capi
"SecretKey":"*******************************", // sercret_key替换为用户的 SecretKey,登录访问管理控制台查看密钥,https://console.cloud.tencent.com/cam/capi
"Region":"ap-guangzhou",                 // 存储桶地域, 替换为客户存储桶所在地域,可以在COS控制台指定存储桶的概览页查看存储桶地域信息,参考 https://console.cloud.tencent.com/cos5/bucket/ ,关于地域的详情见 https://cloud.tencent.com/document/product/436/6224
"SignExpiredTime":360,              // 签名超时时间, 单位s
"ConnectTimeoutInms":6000,          // connect超时时间, 单位ms
"ReceiveTimeoutInms":60000,         // recv超时时间, 单位ms
"UploadPartSize":10485760,          // 上传文件分片大小,1M~5G, 默认为10M
"UploadCopyPartSize":20971520,      // 上传复制文件分片大小,5M~5G, 默认为20M
"UploadThreadPoolSize":5,           // 单文件分块上传线程池大小
"DownloadSliceSize":4194304,        // 下载文件分片大小
"DownloadThreadPoolSize":5,         // 单文件下载线程池大小
"AsynThreadPoolSize":2,             // 异步上传下载线程池大小
"LogoutType":1,                     // 日志输出类型,0:不输出,1:输出到屏幕,2输出到syslog
"LogLevel":3,                       // 日志级别:1: ERR, 2: WARN, 3:INFO, 4:DBG
"IsDomainSameToHost":false,         // 是否使用专有的host
"DestDomain":"",                    // 特定host
"IsUseIntranet":false,              // 是否使用特定ip和端口号
"IntranetAddr":""                   // 特定ip和端口号,例如“127.0.0.1:80”               

使用自定义域名访问 COS

在 config.json 中增加如下配置:

"IsDomainSameToHost":true,
"DestDomain":"mydomain.com",

使用临时密钥访问 COS

#include "cos_api.h"
#include "cos_sys_config.h"
#include "cos_defines.h"
int main(int argc, char *argv[]) {
    qcloud_cos::CosConfig config("./config.json");
    // 如果使用永久密钥不需要填入token,如果使用临时密钥需要填入,临时密钥生成和使用指引参见https://cloud.tencent.com/document/product/436/14048
    config.SetTmpToken("xxx");
    qcloud_cos::CosAPI cos(config);
}

自定义Log回调

#include "cos_api.h"
#include "cos_sys_config.h"
#include "cos_defines.h"
void TestLogCallback(const std::string& log) {
    std::ofstream ofs;
    ofs.open("test.log", std::ios_base::app);
    ofs << log;
    ofs.close();
}
int main(int argc, char** argv) {
    qcloud_cos::CosConfig config("./config.json");
    config.SetLogCallback(&TestLogCallback);
    qcloud_cos::CosAPI cos(config);
}

创建存储桶

#include "cos_api.h"
#include "cos_sys_config.h"
#include "cos_defines.h"

int main(int argc, char *argv[]) {
    // 1. 指定配置文件路径,初始化 CosConfig
    qcloud_cos::CosConfig config("./config.json");
    qcloud_cos::CosAPI cos(config);
    
    // 2. 构造创建存储桶的请求
    std::string bucket_name = "examplebucket-1250000000"; // Bucket名称
    qcloud_cos::PutBucketReq req(bucket_name);
    qcloud_cos::PutBucketResp resp;
    
    // 3. 调用创建存储桶接口
    qcloud_cos::CosResult result = cos.PutBucket(req, &resp);
    
    // 4. 处理调用结果
    if (result.IsSucc()) {
        // 创建成功
    } else {
        // 创建存储桶失败,可以调用 CosResult 的成员函数输出错误信息,例如 requestID 等
        std::cout << "ErrorInfo=" << result.GetErrorMsg() << std::endl;
        std::cout << "HttpStatus=" << result.GetHttpStatus() << std::endl;
        std::cout << "ErrorCode=" << result.GetErrorCode() << std::endl;
        std::cout << "ErrorMsg=" << result.GetErrorMsg() << std::endl;
        std::cout << "ResourceAddr=" << result.GetResourceAddr() << std::endl;
        std::cout << "XCosRequestId=" << result.GetXCosRequestId() << std::endl;
        std::cout << "XCosTraceId=" << result.GetXCosTraceId() << std::endl;
    }
}

查询存储桶列表

#include "cos_api.h"
#include "cos_sys_config.h"
#include "cos_defines.h"

int main(int argc, char *argv[]) {
    // 1. 指定配置文件路径,初始化 CosConfig
    qcloud_cos::CosConfig config("./config.json");
    qcloud_cos::CosAPI cos(config);
    
    // 2. 构造查询存储桶列表的请求
    qcloud_cos::GetServiceReq req;
    qcloud_cos::GetServiceResp resp;
    qcloud_cos::CosResult result = cos.GetService(req, &resp);
    
    // 3. 获取响应信息
    const qcloud_cos::Owner& owner = resp.GetOwner();
    const std::vector<qcloud_cos::Bucket>& buckets = resp.GetBuckets();
    std::cout << "owner.m_id=" << owner.m_id << ", owner.display_name=" << owner.m_display_name << std::endl;
    
    for (std::vector<qcloud_cos::Bucket>::const_iterator itr = buckets.begin(); itr != buckets.end(); ++itr) {
        const qcloud_cos::Bucket& bucket = *itr;
        std::cout << "Bucket name=" << bucket.m_name << ", location="
            << bucket.m_location << ", create_date=" << bucket.m_create_date << std::endl;
    }
    
    // 4. 处理调用结果
    if (result.IsSucc()) {
        // 查询存储桶列表成功
    } else {
        // 查询存储桶列表失败,可以调用 CosResult 的成员函数输出错误信息,比如 requestID 等
        std::cout << "ErrorInfo=" << result.GetErrorMsg() << std::endl;
        std::cout << "HttpStatus=" << result.GetHttpStatus() << std::endl;
        std::cout << "ErrorCode=" << result.GetErrorCode() << std::endl;
        std::cout << "ErrorMsg=" << result.GetErrorMsg() << std::endl;
        std::cout << "ResourceAddr=" << result.GetResourceAddr() << std::endl;
        std::cout << "XCosRequestId=" << result.GetXCosRequestId() << std::endl;
        std::cout << "XCosTraceId=" << result.GetXCosTraceId() << std::endl;
    }
}

上传对象

#include "cos_api.h"
#include "cos_sys_config.h"
#include "cos_defines.h"

int main(int argc, char *argv[]) {
    // 1. 指定配置文件路径,初始化 CosConfig
    qcloud_cos::CosConfig config("./config.json");
    qcloud_cos::CosAPI cos(config);
    
    // 2. 构造上传文件的请求
    std::string bucket_name = "examplebucket-1250000000"; // 上传的目的 Bucket 名称
    std::string object_name = "exampleobject"; //exampleobject 即为对象键(Key),是对象在存储桶中的唯一标识。例如,在对象的访问域名 examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/doc/pic.jpg 中,对象键为 doc/pic.jpg。
    // request 的构造函数中需要传入本地文件路径
    qcloud_cos::PutObjectByFileReq req(bucket_name, object_name, "/path/to/local/file");
    req.SetXCosStorageClass("STANDARD_IA"); // 调用 Set 方法设置元数据等
    qcloud_cos::PutObjectByFileResp resp;
    
    // 3. 调用上传文件接口
    qcloud_cos::CosResult result = cos.PutObject(req, &resp);
    
    // 4. 处理调用结果
    if (result.IsSucc()) {
        // 上传文件成功
    } else {
        // 上传文件失败,可以调用 CosResult 的成员函数输出错误信息,比如 requestID 等
        std::cout << "ErrorInfo=" << result.GetErrorMsg() << std::endl;
        std::cout << "HttpStatus=" << result.GetHttpStatus() << std::endl;
        std::cout << "ErrorCode=" << result.GetErrorCode() << std::endl;
        std::cout << "ErrorMsg=" << result.GetErrorMsg() << std::endl;
        std::cout << "ResourceAddr=" << result.GetResourceAddr() << std::endl;
        std::cout << "XCosRequestId=" << result.GetXCosRequestId() << std::endl;
        std::cout << "XCosTraceId=" << result.GetXCosTraceId() << std::endl;
    }
}

查询对象列表

#include "cos_api.h"
#include "cos_sys_config.h"
#include "cos_defines.h"

int main(int argc, char *argv[]) {
    // 1. 指定配置文件路径,初始化 CosConfig
    qcloud_cos::CosConfig config("./config.json");
    qcloud_cos::CosAPI cos(config);
    
    // 2. 构造查询对象列表的请求
    std::string bucket_name = "examplebucket-1250000000"; // 上传的目标存储桶名称
    qcloud_cos::GetBucketReq req(bucket_name);
    qcloud_cos::GetBucketResp resp;
    qcloud_cos::CosResult result = cos.GetBucket(req, &resp);   
    
    std::vector<qcloud_cos::Content> cotents = resp.GetContents();
    for (std::vector<qcloud_cos::Content>::const_iterator itr = cotents.begin(); itr != cotents.end(); ++itr) {
    	const qcloud_cos::Content& content = *itr;
        std::cout << "key name=" << content.m_key << ", lastmodified ="
            << content.m_last_modified << ", size=" << content.m_size << std::endl;
    }
    
    // 3. 处理调用结果
    if (result.IsSucc()) {
        // 查询对象列表成功
    } else {
        // 查询对象列表失败,可以调用 CosResult 的成员函数输出错误信息,例如 requestID 等
        std::cout << "ErrorInfo=" << result.GetErrorMsg() << std::endl;
        std::cout << "HttpStatus=" << result.GetHttpStatus() << std::endl;
        std::cout << "ErrorCode=" << result.GetErrorCode() << std::endl;
        std::cout << "ErrorMsg=" << result.GetErrorMsg() << std::endl;
        std::cout << "ResourceAddr=" << result.GetResourceAddr() << std::endl;
        std::cout << "XCosRequestId=" << result.GetXCosRequestId() << std::endl;
        std::cout << "XCosTraceId=" << result.GetXCosTraceId() << std::endl;
    }
}

下载对象

#include "cos_api.h"
#include "cos_sys_config.h"
#include "cos_defines.h"

int main(int argc, char *argv[]) {
    // 1. 指定配置文件路径,初始化 CosConfig
    qcloud_cos::CosConfig config("./config.json");
    qcloud_cos::CosAPI cos(config);
    
    // 2. 构造下载对象的请求
    std::string bucket_name = "examplebucket-1250000000"; // 上传的目的 Bucket 名称
    std::string object_name = "exampleobject"; // exampleobject 即为对象键(Key),是对象在存储桶中的唯一标识。例如,在对象的访问域名 examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/doc/pic.jpg 中,对象键为 doc/pic.jpg。
    std::string local_path = "/tmp/exampleobject";
    // request 需要提供 appid、bucketname、object,以及本地的路径(包含文件名)
    qcloud_cos::GetObjectByFileReq req(bucket_name, object_name, local_path);
    qcloud_cos::GetObjectByFileResp resp;
    
    // 3. 调用下载对象接口
    qcloud_cos::CosResult result = cos.GetObject(req, &resp);
    
    // 4. 处理调用结果
    if (result.IsSucc()) {
        // 下载文件成功
    } else {
        // 下载文件失败,可以调用 CosResult 的成员函数输出错误信息,例如 requestID 等
        std::cout << "ErrorInfo=" << result.GetErrorMsg() << std::endl;
        std::cout << "HttpStatus=" << result.GetHttpStatus() << std::endl;
        std::cout << "ErrorCode=" << result.GetErrorCode() << std::endl;
        std::cout << "ErrorMsg=" << result.GetErrorMsg() << std::endl;
        std::cout << "ResourceAddr=" << result.GetResourceAddr() << std::endl;
        std::cout << "XCosRequestId=" << result.GetXCosRequestId() << std::endl;
        std::cout << "XCosTraceId=" << result.GetXCosTraceId() << std::endl;
    }
}

删除对象

#include "cos_api.h"
#include "cos_sys_config.h"
#include "cos_defines.h"

int main(int argc, char *argv[]) {
    // 1. 指定配置文件路径,初始化 CosConfig
    qcloud_cos::CosConfig config("./config.json");
    qcloud_cos::CosAPI cos(config);
    
    // 2. 构造删除对象的请求
    std::string bucket_name = "examplebucket-1250000000"; // 上传的目标存储桶名称
    std::string object_name = "exampleobject"; // exampleobject 即为对象键(Key),是对象在存储桶中的唯一标识。例如,在对象的访问域名 examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/doc/pic.jpg 中,对象键为 doc/pic.jpg。
    // 3. 调用删除对象接口
	qcloud_cos::DeleteObjectReq req(bucket_name, object_name);
	qcloud_cos::DeleteObjectResp resp;
	qcloud_cos::CosResult result = cos.DeleteObject(req, &resp); 
    
    // 4. 处理调用结果
    if (result.IsSucc()) {
        // 删除对象成功
    } else {
        // 删除对象失败,可以调用 CosResult 的成员函数输出错误信息,例如 requestID 等
        std::cout << "ErrorInfo=" << result.GetErrorMsg() << std::endl;
        std::cout << "HttpStatus=" << result.GetHttpStatus() << std::endl;
        std::cout << "ErrorCode=" << result.GetErrorCode() << std::endl;
        std::cout << "ErrorMsg=" << result.GetErrorMsg() << std::endl;
        std::cout << "ResourceAddr=" << result.GetResourceAddr() << std::endl;
        std::cout << "XCosRequestId=" << result.GetXCosRequestId() << std::endl;
        std::cout << "XCosTraceId=" << result.GetXCosTraceId() << std::endl;
    }
}

cos-cpp-sdk-v5's People

Contributors

chen-honggang avatar huberyxiao avatar huberyxxiao avatar jackyding2679 avatar jimmyyan avatar konakonall avatar maddoxwang avatar mrkjn avatar rabbitliu avatar shuiqingh avatar shurunxuan avatar telunsu avatar toranger avatar vintmd avatar wqingzhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cos-cpp-sdk-v5's Issues

error: implicitly-declared ‘qcloud_cos::LoggingEnabled::LoggingEnabled(const qcloud_cos::LoggingEnabled&)’ is deprecated [-Werror=deprecated-copy]

ake
/usr/bin/cmake -S/root/cos-cpp-sdk-v5-5.5.5 -B/root/cos-cpp-sdk-v5-5.5.5/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /root/cos-cpp-sdk-v5-5.5.5/build/CMakeFiles /root/cos-cpp-sdk-v5-5.5.5/build//CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/root/cos-cpp-sdk-v5-5.5.5/build'
make -f src/CMakeFiles/cossdk.dir/build.make src/CMakeFiles/cossdk.dir/depend
make[2]: Entering directory '/root/cos-cpp-sdk-v5-5.5.5/build'
cd /root/cos-cpp-sdk-v5-5.5.5/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /root/cos-cpp-sdk-v5-5.5.5 /root/cos-cpp-sdk-v5-5.5.5/src /root/cos-cpp-sdk-v5-5.5.5/build /root/cos-cpp-sdk-v5-5.5.5/build/src /root/cos-cpp-sdk-v5-5.5.5/build/src/CMakeFiles/cossdk.dir/DependInfo.cmake --color=
Consolidate compiler generated dependencies of target cossdk
make[2]: Leaving directory '/root/cos-cpp-sdk-v5-5.5.5/build'
make -f src/CMakeFiles/cossdk.dir/build.make src/CMakeFiles/cossdk.dir/build
make[2]: Entering directory '/root/cos-cpp-sdk-v5-5.5.5/build'
[ 2%] Building CXX object src/CMakeFiles/cossdk.dir/cos_api.cpp.o
cd /root/cos-cpp-sdk-v5-5.5.5/build/src && /usr/bin/c++ -I/root/cos-cpp-sdk-v5-5.5.5/include -I/root/cos-cpp-sdk-v5-5.5.5/third_party/include -std=c++11 -Werror -Wall -Wextra -MD -MT src/CMakeFiles/cossdk.dir/cos_api.cpp.o -MF CMakeFiles/cossdk.dir/cos_api.cpp.o.d -o CMakeFiles/cossdk.dir/cos_api.cpp.o -c /root/cos-cpp-sdk-v5-5.5.5/src/cos_api.cpp
In file included from /root/cos-cpp-sdk-v5-5.5.5/include/op/bucket_op.h:16,
from /root/cos-cpp-sdk-v5-5.5.5/include/cos_api.h:4,
from /root/cos-cpp-sdk-v5-5.5.5/src/cos_api.cpp:1:
/root/cos-cpp-sdk-v5-5.5.5/include/response/bucket_resp.h: In member function ‘qcloud_cos::LoggingEnabled qcloud_cos::GetBucketLoggingResp::GetLoggingEnabled() const’:
/root/cos-cpp-sdk-v5-5.5.5/include/response/bucket_resp.h:343:53: error: implicitly-declared ‘qcloud_cos::LoggingEnabled::LoggingEnabled(const qcloud_cos::LoggingEnabled&)’ is deprecated [-Werror=deprecated-copy]
343 | LoggingEnabled GetLoggingEnabled() const { return m_rules; }
| ^~~~~~~
In file included from /root/cos-cpp-sdk-v5-5.5.5/include/cos_sys_config.h:5,
from /root/cos-cpp-sdk-v5-5.5.5/include/op/bucket_op.h:10,
from /root/cos-cpp-sdk-v5-5.5.5/include/cos_api.h:4,
from /root/cos-cpp-sdk-v5-5.5.5/src/cos_api.cpp:1:
/root/cos-cpp-sdk-v5-5.5.5/include/cos_defines.h:516:19: note: because ‘qcloud_cos::LoggingEnabled’ has user-provided ‘qcloud_cos::LoggingEnabled& qcloud_cos::LoggingEnabled::operator=(const qcloud_cos::LoggingEnabled&)’
516 | LoggingEnabled& operator=(const LoggingEnabled& obj) {
| ^~~~~~~~
In file included from /root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/Var.h:24,
from /root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/JSON/Array.h:23,
from /root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/JSON/Object.h:22,
from /root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/JSON/ParserImpl.h:22,
from /root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/JSON/Parser.h:22,
from /root/cos-cpp-sdk-v5-5.5.5/include/cos_config.h:10,
from /root/cos-cpp-sdk-v5-5.5.5/include/op/base_op.h:9,
from /root/cos-cpp-sdk-v5-5.5.5/include/op/bucket_op.h:11,
from /root/cos-cpp-sdk-v5-5.5.5/include/cos_api.h:4,
from /root/cos-cpp-sdk-v5-5.5.5/src/cos_api.cpp:1:
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = signed char; T = unsigned int]’:
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:370:23: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = signed char; T = unsigned int]’
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:771:36: required from here
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const signed cha’ and ‘unsigned int’ [-Werror=sign-compare]
419 | if (from > std::numeric_limits::max())
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = signed char; T = long unsigned int]’:
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:370:23: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = signed char; T = long unsigned int]’
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:776:36: required from here
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const signed cha’ and ‘long unsigned int’ [-Werror=sign-compare]
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = signed char; T = long long unsigned int]’:
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:370:23: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = signed char; T = long long unsigned int]’
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:788:36: required from here
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const signed cha’ and ‘long long unsigned int’ [-Werror=sign-compare]
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = short int; T = unsigned int]’:
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:370:23: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = short int; T = unsigned int]’
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:927:36: required from here
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const short int’ and ‘unsigned int’ [-Werror=sign-compare]
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = short int; T = long unsigned int]’:
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:370:23: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = short int; T = long unsigned int]’
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:932:36: required from here
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const short int’ and ‘long unsigned int’ [-Werror=sign-compare]
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = short int; T = long long unsigned int]’:
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:370:23: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = short int; T = long long unsigned int]’
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:944:36: required from here
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const short int’ and ‘long long unsigned int’ [-Werror=sign-compare]
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = int; T = unsigned int]’:
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:370:23: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = int; T = unsigned int]’
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:1081:36: required from here
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const int’ and ‘unsigned int’ [-Werror=sign-compare]
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = int; T = long unsigned int]’:
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:370:23: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = int; T = long unsigned int]’
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:1086:36: required from here
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const int’ and ‘long unsigned int’ [-Werror=sign-compare]
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = int; T = long long unsigned int]’:
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:370:23: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = int; T = long long unsigned int]’
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:1098:36: required from here
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const int’ and ‘long long unsigned int’ [-Werror=sign-compare]
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long int; T = long unsigned int]’:
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:370:23: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = long int; T = long unsigned int]’
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:1238:36: required from here
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long int’ and ‘long unsigned int’ [-Werror=sign-compare]
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long int; T = long long unsigned int]’:
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:370:23: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = long int; T = long long unsigned int]’
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:1250:36: required from here
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long int’ and ‘long long unsigned int’ [-Werror=sign-compare]
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long long int; T = long unsigned int]’:
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:370:23: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = long long int; T = long unsigned int]’
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:3322:36: required from here
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long long int’ and ‘long unsigned int’ [-Werror=sign-compare]
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long long int; T = long long unsigned int]’:
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:370:23: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = long long int; T = long long unsigned int]’
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:3332:36: required from here
/root/cos-cpp-sdk-v5-5.5.5/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long long int’ and ‘long long unsigned int’ [-Werror=sign-compare]
cc1plus: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/cossdk.dir/build.make:79: src/CMakeFiles/cossdk.dir/cos_api.cpp.o] Error 1
make[2]: Leaving directory '/root/cos-cpp-sdk-v5-5.5.5/build'
make[1]: *** [CMakeFiles/Makefile2:121: src/CMakeFiles/cossdk.dir/all] Error 2
make[1]: Leaving directory '/root/cos-cpp-sdk-v5-5.5.5/build'
make: *** [Makefile:94: all] Error 2

求助,编译时链接Poco库出现错误, undefined reference to `Poco::Net::HTTPSStreamFactory::registerFactory()'

编译代码时链接Poco出现问题,平台 Arch linux, 使用vcpkg管理第三方库

Message

====================[ Build | TestCos | Debug ]=================================
/home/cvrain/.local/share/JetBrains/Toolbox/apps/clion/bin/cmake/linux/x64/bin/cmake --build /mnt/Workspace/CLang/TestCos/cmake-build-debug --target TestCos -j 10
[1/1] Linking CXX executable TestCos
FAILED: TestCos 
: && /usr/bin/clang++ -g  CMakeFiles/TestCos.dir/src/main.cpp.o -o TestCos -L/mnt/Workspace/CLang/TestCos/libs/linux -Wl,-rpath,/mnt/Workspace/CLang/TestCos/libs/linux  vcpkg_installed/x64-linux/debug/lib/libfmtd.a  vcpkg_installed/x64-linux/debug/lib/libloguru.a  vcpkg_installed/x64-linux/debug/lib/libgtest.a  vcpkg_installed/x64-linux/debug/lib/manual-link/libgtest_main.a  vcpkg_installed/x64-linux/debug/lib/libgmock.a  vcpkg_installed/x64-linux/debug/lib/manual-link/libgmock_main.a  vcpkg_installed/x64-linux/debug/lib/libssl.a  vcpkg_installed/x64-linux/debug/lib/libcrypto.a  vcpkg_installed/x64-linux/debug/lib/libPocoFoundationd.a  vcpkg_installed/x64-linux/debug/lib/libPocoCryptod.a  vcpkg_installed/x64-linux/debug/lib/libPocoXMLd.a  vcpkg_installed/x64-linux/debug/lib/libPocoJSONd.a  vcpkg_installed/x64-linux/debug/lib/libPocoUtild.a  vcpkg_installed/x64-linux/debug/lib/libPocoNetd.a  vcpkg_installed/x64-linux/debug/lib/libPocoNetSSLd.a  -Wl,-Bstatic  -lcossdk  vcpkg_installed/x64-linux/debug/lib/libgmock.a  vcpkg_installed/x64-linux/debug/lib/libgtest.a  vcpkg_installed/x64-linux/debug/lib/libPocoCryptod.a  -Wl,-Bdynamic  vcpkg_installed/x64-linux/debug/lib/libssl.a  vcpkg_installed/x64-linux/debug/lib/libcrypto.a  vcpkg_installed/x64-linux/debug/lib/libPocoUtild.a  vcpkg_installed/x64-linux/debug/lib/libPocoXMLd.a  vcpkg_installed/x64-linux/debug/lib/libexpat.a  -lm  vcpkg_installed/x64-linux/debug/lib/libPocoJSONd.a  vcpkg_installed/x64-linux/debug/lib/libPocoNetd.a  vcpkg_installed/x64-linux/debug/lib/libPocoFoundationd.a  vcpkg_installed/x64-linux/debug/lib/libpcre2-8.a  vcpkg_installed/x64-linux/debug/lib/libz.a  -lpthread  -ldl  -lrt && :
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(cos_api.cpp.o): in function `qcloud_cos::CosAPI::CosInit()':
/mnt/Workspace/Program/cos-cpp-sdk-v5/src/cos_api.cpp:40:(.text+0x36d): undefined reference to `Poco::Net::HTTPSStreamFactory::registerFactory()'
/usr/bin/ld: /mnt/Workspace/Program/cos-cpp-sdk-v5/src/cos_api.cpp:41:(.text+0x377): undefined reference to `Poco::Net::initializeSSL()'
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(cos_config.cpp.o): in function `qcloud_cos::CosConfig::InitConf(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/mnt/Workspace/Program/cos-cpp-sdk-v5/src/cos_config.cpp:79:(.text+0x4c5): undefined reference to `Poco::JSON::Parser::Parser(Poco::SharedPtr<Poco::JSON::Handler, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Handler> > const&, unsigned long)'
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(cos_config.cpp.o): in function `Poco::SharedPtr<Poco::JSON::Object, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Object> > const& Poco::Dynamic::Var::extract<Poco::SharedPtr<Poco::JSON::Object, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Object> > >() const':
/mnt/Workspace/Program/cos-cpp-sdk-v5/third_party/include/Poco/Dynamic/Var.h:221:(.text._ZNK4Poco7Dynamic3Var7extractINS_9SharedPtrINS_4JSON6ObjectENS_16ReferenceCounterENS_13ReleasePolicyIS5_EEEEEERKT_v[_ZNK4Poco7Dynamic3Var7extractINS_9SharedPtrINS_4JSON6ObjectENS_16ReferenceCounterENS_13ReleasePolicyIS5_EEEEEERKT_v]+0x2ed): undefined reference to `Poco::format(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Poco::Any const&, Poco::Any const&)'
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(cos_config.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const& Poco::Dynamic::Var::extract<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >() const':
/mnt/Workspace/Program/cos-cpp-sdk-v5/third_party/include/Poco/Dynamic/Var.h:221:(.text._ZNK4Poco7Dynamic3Var7extractINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERKT_v[_ZNK4Poco7Dynamic3Var7extractINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERKT_v]+0x2ed): undefined reference to `Poco::format(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Poco::Any const&, Poco::Any const&)'
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(cos_config.cpp.o): in function `unsigned long const& Poco::Dynamic::Var::extract<unsigned long>() const':
/mnt/Workspace/Program/cos-cpp-sdk-v5/third_party/include/Poco/Dynamic/Var.h:221:(.text._ZNK4Poco7Dynamic3Var7extractImEERKT_v[_ZNK4Poco7Dynamic3Var7extractImEERKT_v]+0x2ed): undefined reference to `Poco::format(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Poco::Any const&, Poco::Any const&)'
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(cos_config.cpp.o): in function `bool const& Poco::Dynamic::Var::extract<bool>() const':
/mnt/Workspace/Program/cos-cpp-sdk-v5/third_party/include/Poco/Dynamic/Var.h:221:(.text._ZNK4Poco7Dynamic3Var7extractIbEERKT_v[_ZNK4Poco7Dynamic3Var7extractIbEERKT_v]+0x2ed): undefined reference to `Poco::format(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Poco::Any const&, Poco::Any const&)'
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(object_op.cpp.o): in function `qcloud_cos::ObjectOp::CheckSinglePart(qcloud_cos::PutObjectByFileReq const&, unsigned long, unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/mnt/Workspace/Program/cos-cpp-sdk-v5/src/op/object_op.cpp:124:(.text+0xfac): undefined reference to `Poco::DigestEngine::digestToHex[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&)'
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(object_op.cpp.o): in function `qcloud_cos::ObjectOp::CheckResumableDownloadTask(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, unsigned long*)':
/mnt/Workspace/Program/cos-cpp-sdk-v5/src/op/object_op.cpp:262:(.text+0x2ba7): undefined reference to `Poco::JSON::Parser::Parser(Poco::SharedPtr<Poco::JSON::Handler, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Handler> > const&, unsigned long)'
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(object_op.cpp.o): in function `qcloud_cos::ObjectOp::PutObject(qcloud_cos::PutObjectByStreamReq const&, qcloud_cos::PutObjectByStreamResp*, std::shared_ptr<qcloud_cos::TransferHandler> const&)':
/mnt/Workspace/Program/cos-cpp-sdk-v5/src/op/object_op.cpp:402:(.text+0x82ca): undefined reference to `Poco::DigestEngine::digestToHex[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&)'
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(object_op.cpp.o): in function `qcloud_cos::ObjectOp::PutObject(qcloud_cos::PutObjectByFileReq const&, qcloud_cos::PutObjectByFileResp*, std::shared_ptr<qcloud_cos::TransferHandler> const&)':
/mnt/Workspace/Program/cos-cpp-sdk-v5/src/op/object_op.cpp:476:(.text+0x96bd): undefined reference to `Poco::DigestEngine::digestToHex[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&)'
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(object_op.cpp.o): in function `qcloud_cos::ObjectOp::UploadPartData(qcloud_cos::UploadPartDataReq const&, qcloud_cos::UploadPartDataResp*)':
/mnt/Workspace/Program/cos-cpp-sdk-v5/src/op/object_op.cpp:752:(.text+0xf5cd): undefined reference to `Poco::DigestEngine::digestToHex[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&)'
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(object_op.cpp.o): in function `Poco::RecursiveDirectoryIteratorImpl<Poco::ChildrenFirstTraverse>::RecursiveDirectoryIteratorImpl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned short)':
/mnt/Workspace/Program/cos-cpp-sdk-v5/third_party/include/Poco/RecursiveDirectoryIteratorImpl.h:44:(.text._ZN4Poco30RecursiveDirectoryIteratorImplINS_21ChildrenFirstTraverseEEC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEt[_ZN4Poco30RecursiveDirectoryIteratorImplINS_21ChildrenFirstTraverseEEC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEt]+0x82): undefined reference to `Poco::ChildrenFirstTraverse::ChildrenFirstTraverse(std::pointer_to_unary_function<std::stack<Poco::DirectoryIterator, std::deque<Poco::DirectoryIterator, std::allocator<Poco::DirectoryIterator> > > const&, unsigned short>, unsigned short)'
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(file_util.cpp.o): in function `qcloud_cos::FileUtil::GetFileMd5(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/mnt/Workspace/Program/cos-cpp-sdk-v5/src/util/file_util.cpp:123:(.text+0x75e): undefined reference to `Poco::DigestEngine::digestToHex[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&)'
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(file_upload_task.cpp.o): in function `qcloud_cos::FileUploadTask::UploadTask()':
/mnt/Workspace/Program/cos-cpp-sdk-v5/src/op/file_upload_task.cpp:143:(.text+0x9ec): undefined reference to `Poco::DigestEngine::digestToHex[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&)'
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(http_sender.cpp.o): in function `qcloud_cos::HttpSender::SendRequest(std::shared_ptr<qcloud_cos::TransferHandler> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, std::istream&, unsigned long, unsigned long, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >*, std::ostream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/mnt/Workspace/Program/cos-cpp-sdk-v5/src/util/http_sender.cpp:112:(.text+0x7a8): undefined reference to `Poco::Net::Context::Context(Poco::Net::Context::Usage, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Poco::Net::Context::VerificationMode, int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /mnt/Workspace/Program/cos-cpp-sdk-v5/src/util/http_sender.cpp:115:(.text+0x8c7): undefined reference to `Poco::Net::HTTPSClientSession::HTTPSClientSession(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned short, Poco::AutoPtr<Poco::Net::Context>)'
/usr/bin/ld: /mnt/Workspace/Program/cos-cpp-sdk-v5/src/util/http_sender.cpp:236:(.text+0x24f2): undefined reference to `Poco::DigestEngine::digestToHex[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&)'
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(http_sender.cpp.o): in function `qcloud_cos::HttpSender::SendRequest(std::shared_ptr<qcloud_cos::TransferHandler> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, unsigned long, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::ostream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, unsigned long*, bool, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/mnt/Workspace/Program/cos-cpp-sdk-v5/src/util/http_sender.cpp:333:(.text+0x51c0): undefined reference to `Poco::Net::Context::Context(Poco::Net::Context::Usage, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Poco::Net::Context::VerificationMode, int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /mnt/Workspace/Program/cos-cpp-sdk-v5/src/util/http_sender.cpp:336:(.text+0x52df): undefined reference to `Poco::Net::HTTPSClientSession::HTTPSClientSession(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned short, Poco::AutoPtr<Poco::Net::Context>)'
/usr/bin/ld: /mnt/Workspace/Program/cos-cpp-sdk-v5/src/util/http_sender.cpp:465:(.text+0x704b): undefined reference to `Poco::DigestEngine::digestToHex[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&)'
/usr/bin/ld: /mnt/Workspace/CLang/TestCos/libs/linux/libcossdk.a(codec_util.cpp.o): in function `qcloud_cos::CodecUtil::HmacSha1Hex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/mnt/Workspace/Program/cos-cpp-sdk-v5/src/util/codec_util.cpp:100:(.text+0xa07): undefined reference to `Poco::DigestEngine::digestToHex[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&)'
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

CMakeLists.txt

cmake_minimum_required(VERSION 3.26)
project(TestCos)

set(CMAKE_CXX_STANDARD 20)

enable_testing()

find_package(GTest CONFIG REQUIRED)
find_package(fmt CONFIG REQUIRED)
find_package(loguru CONFIG REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Poco REQUIRED COMPONENTS Foundation Crypto XML JSON Util Net NetSSL)

set(COS_SDK_H src/cos-cpp-sdk-v5/include)

include_directories(${COS_SDK_H})

if (WIN32)
    link_directories(libs/Win32)
elseif (UNIX)
    link_directories(libs/linux)
elseif (APPLE)
    link_directories(libs/macOS)
else ()
    link_directories(libs/x64)

endif ()

set(SRC src/main.cpp)

add_executable(TestCos ${SRC})
target_link_libraries(TestCos PRIVATE fmt::fmt loguru
        GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main
        OpenSSL::SSL OpenSSL::Crypto
        Poco::Foundation  Poco::Crypto Poco::XML Poco::JSON Poco::Util Poco::Net Poco::NetSSL
        libcossdk.a)

vcpkg.json

{
    "name": "test-cos",
    "version": "1.0.0",
    "dependencies": [
        {"name": "openssl"},
        {"name": "loguru"},
        {"name":  "fmt"},
        {"name":  "poco", "features": ["crypto","netssl"]},
        {"name": "gtest"}
    ]
}

main.cpp

#include <loguru/loguru.hpp>

#include <cos_api.h>
#include <cos_sys_config.h>
#include <cos_config.h>
#include <cos_defines.h>
#include <cos_params.h>

#include <string>

void CosLogCallBack(const std::string& logInfo);

int main(int argc, char **argv) {
    loguru::init(argc, argv);

    LOG_F(INFO, "Init cos");
    qcloud_cos::CosConfig config("./cos-config.json");
    config.SetLogCallback(&CosLogCallBack);
    qcloud_cos::CosAPI cosApi(config);


    return 0;
}

void CosLogCallBack(const std::string& logInfo)
{
    LOG_F(INFO, "%s", logInfo.c_str());
}

Valgrind 报:Mismatched free() / delete / delete []错误

CosResult::ParseFromHttpResponse里面的cstr要用delete []释放,否则会报错,日志如下:

==21956== Mismatched free() / delete / delete []
==21956== at 0x4C2B40D: operator delete(void*) (vg_replace_malloc.c:586)
==21956== by 0x64FAC2: qcloud_cos::CosResult::ParseFromHttpResponse(std::map<std::string, std::string, std::lessstd::string, std::allocator<std::pair<std::string const, std::string> > > const&, std::string const&) (in /root/projects/luckin/mp/cmake_build/mp)
==21956== by 0x66AE65: qcloud_cos::BaseOp::NormalAction(std::string const&, std::string const&, qcloud_cos::BaseReq const&, std::map<std::string, std::string, std::lessstd::string, std::allocator<std::pair<std::string const, std::string> > > const&, std::map<std::string, std::string, std::lessstd::string, std::allocator<std::pair<std::string const, std::string> > > const&, std::string const&, bool, qcloud_cos::BaseResp*) (in /root/projects/luckin/mp/cmake_build/mp)
==21956== by 0x66A8C8: qcloud_cos::BaseOp::NormalAction(std::string const&, std::string const&, qcloud_cos::BaseReq const&, std::string const&, bool, qcloud_cos::BaseResp*) (in /root/projects/luckin/mp/cmake_build/mp)
==21956== by 0x638896: qcloud_cos::ObjectOp::HeadObject(qcloud_cos::HeadObjectReq const&, qcloud_cos::HeadObjectResp*) (in /root/projects/luckin/mp/cmake_build/mp)
==21956== by 0x63870F: qcloud_cos::ObjectOp::IsObjectExist(std::string const&, std::string const&) (in /root/projects/luckin/mp/cmake_build/mp)
==21956== by 0x60129A: qcloud_cos::CosAPI::IsObjectExist(std::string const&, std::string const&) (in /root/projects/luckin/mp/cmake_build/mp)

能不能优化。。。按手册根本无法正确配置,对新手真的很不友好,还收费呢哥,直接抄oss吧。。。

[root@f23bfab220b6 build]# ldd /etc/yum.repos.d/cos-cpp-sdk-v5/third_party/lib/linux/poco/libPocoCrypto.so
ldd: warning: you do not have execution permission for `/etc/yum.repos.d/cos-cpp-sdk-v5/third_party/lib/linux/poco/libPocoCrypto.so'
linux-vdso.so.1 (0x00007ffe537de000)
libPocoFoundation.so.64 => not found
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f1e38940000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f1e3873c000)
librt.so.1 => /lib64/librt.so.1 (0x00007f1e38534000)
libssl.so.10 => not found
libcrypto.so.10 => not found
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f1e3819f000)
libm.so.6 => /lib64/libm.so.6 (0x00007f1e37e1d000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f1e37c05000)
libc.so.6 => /lib64/libc.so.6 (0x00007f1e37840000)
/lib64/ld-linux-x86-64.so.2 (0x00007f1e38d99000)

关于长连接的问题

sdk貌似不支持 keepalive
然后我修改sdk源码后,强行在header中加入 Connection - keepalive
一次http 请求后,服务端 无视keepalive,依然关闭连接。

1、http协议的 keepalive 怎么设置,才能有效?因为我需要对 大量的key进行读取数据
2、请问有基于tcp协议的sdk吗?
3、假如一个key的数据很大,我看现在的处理是 写到文件,能设置回调分段处理吗(我拿到一部分就转发走)

新手开发的?

不提供二进制?
SDK不是提供方便的吗?大家的时间不是时间?1000个人使用,每个人浪费5个小时,也浪费了5000小时.
太多依赖,折腾下来要半天.

sdk依赖这么多第三方库

要不这样,弄个详细文档,应该怎么弄,自己去封装一个接口也比用这么大一块方便
有时候只需要单独一个接口,比如就需要上传,需要搞一大堆

Fedora25下lib中提供的jsoncpp可能有问题

编译demo最后报错如下

../lib/libcossdk.a(cos_config.cpp.o):在函数‘qcloud_cos::CosConfig::InitConf(std::__cxx11::basic_string<char, std::char_traits, >std::allocator > const&)’中:
cos_config.cpp:(.text+0x386):对‘Json::Value::asStringabi:cxx11 const’未定义的引用

手动编译jsoncpp替换掉原来lib/libjsoncpp.a和include/json/*.h之后编译成功。

注释中含有中文的情况下,中文和英文联合起来,吞掉了注释的*/,导致bug

https://github.com/tencentyun/cos-cpp-sdk-v5/blob/master/include/response/object_resp.h#L652
这个文件,下载下来是UTF-8编码的,在用VS Code编译时会发生报错,如下图
C1071 在注释中遇到意外的文件结束 .\include\response\object_resp.h
error

Line 652 /批量及目录操作接口/
这行如果转GB2132的话,会变成 /鎵归噺鍙婄洰褰曟搷浣滄帴鍙?/
error
也就少了一个
/ 做注释终结器

这里如果改成 /*批量及目录操作接口 */ 再去转GB2132 就正常了
success

可否指定一下依赖版本?

ubuntu 16.04下,通过apt直接安装依赖,无法编译,应该是apt带的Poco版本比较低。最好指定一下所需依赖的最低版本或指定一个版本。

utf-8

nice to meet you.
If you do not enable utf-8 for this project, it will not build.
We want to use it for our project, but we don't want to enable utf-8.
Any good way?

这个sdk可真烂!水平太次

搞不懂还使用什么poco,婆娘的裹脚一般,如果不是使用你们腾讯云,懒得采纳。一堆的bug,还得自己修复。

POCO headers are outdated.

The current stable release of POCO from https://pocoproject.org/download/index.html is 1.8.1.
The 1.81 POCO has inline Timespan::~Timespan() in Poco/Timespan.h, but the POCO headers in cos-cpp-sdk-v5 does not. So compile errors will happend:

libcossdk.a(http_sender.cpp.o): In function `qcloud_cos::HttpSender::SendRequest(std::string const&, std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, std::istream&, unsigned long, unsigned long, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >*, std::ostream&, std::string*, bool)':
http_sender.cpp:(.text+0x769): undefined reference to `Poco::Timespan::~Timespan()'

Update of cos-cpp-sdk-v5-master/include/Poco/Timespan.h will solve this issue.

不能在dll中使用

不能在dll中使用,只要引用了qcloud_cos::CosAPI就会挂掉,即使不调用也会挂掉,dllmain都进不去
是不是你们一堆全局变量/静态变量哟

竟然没有提供windows版本的debug库文件,还得自己编译,Windows碰到PocoNetSSL的问题

对poco不太熟悉,硬着头皮发现使用cmake编译时,竟然没有编译出PocoNetSSL

find_package(OpenSSL)
if(OPENSSL_FOUND)

endif()

怎么样才能找到openssl呢,我看poco的子仓库有openssl,但是里面都是预编译好的,有debug版本,但是怎么配合find_package,让cmake正确build呢?

The easiest way to install OpenSSL on Windows is to get the pre-built
libraries from the pocoproject/openssl Git repository at
<https://github.com/pocoproject/openssl>. This repository is included
as a submodule in the poco GitHub repository, but not in the release
source code packages. You can also provide your own OpenSSL build by
editing the Visual Studio project files.

poco的readme中也说了,在Windows上最简单的方式就是获取预编译的库

how can i make in MacOS arm64( apple m1)

"typeinfo for Poco::JSON::Array", referenced from:
Poco::Dynamic::VarHolderImplPoco::JSON::Array::type() const in cos_demo.cpp.o
"typeinfo for Poco::Task", referenced from:
typeinfo for qcloud_cos::AsyncTask in libcossdk.a(cos_api.cpp.o)
"typeinfo for Poco::Dynamic::VarHolder", referenced from:
typeinfo for Poco::Dynamic::VarHolderImpl in cos_demo.cpp.o
typeinfo for Poco::Dynamic::VarHolderImpl<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > in cos_demo.cpp.o
typeinfo for Poco::Dynamic::VarHolderImpl<Poco::SharedPtr<Poco::JSON::Object, Poco::ReferenceCounter, Poco::ReleasePolicyPoco::JSON::Object > > in cos_demo.cpp.o
typeinfo for Poco::Dynamic::VarHolderImplPoco::JSON::Array in cos_demo.cpp.o
typeinfo for Poco::Dynamic::VarHolderImpl<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > in libcossdk.a(object_op.cpp.o)
typeinfo for Poco::Dynamic::VarHolderImpl<Poco::SharedPtr<Poco::JSON::Object, Poco::ReferenceCounter, Poco::ReleasePolicyPoco::JSON::Object > > in libcossdk.a(object_op.cpp.o)
"typeinfo for Poco::Runnable", referenced from:
typeinfo for qcloud_cos::FileCopyTask in libcossdk.a(file_copy_task.cpp.o)
typeinfo for qcloud_cos::FileDownTask in libcossdk.a(file_download_task.cpp.o)
typeinfo for qcloud_cos::FileUploadTask in libcossdk.a(file_upload_task.cpp.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/cos-demo] Error 1
make[1]: *** [demo/CMakeFiles/cos-demo.dir/all] Error 2
make: *** [all] Error 2

Qt MinGW64库编译

你好,我使用的是Qt5.14.2,采用MinGW-64 7.3.0编译器,编译过程中报了很多错,CMake文件也没有针对MinGW编译器提供编译选项,要怎么处理?

经常出现上传超时的错误,和网速没关系,因为使用你们自带的测试工具可以正常上传

经常出现上传超时的错误,和网速没关系,因为使用你们自带的测试工具可以正常上传
下面是打印的出错信息,GetErrorMsg返回了一个超时的错误,HttpStatus返回-1

HttpStatus:-1
GetErrorCode:
GetErrorMsg:TimeoutException:Timeout
GetResourceAddr:
GetXCosRequestId:
GetXCosTraceId:
Tag:

我也联系过售后,他查了服务器那边日志,说是传的太慢,然后被服务器踢掉了

这期发布的经过测试了吗

首先三个问题

  1. include/trsf/async_task.h中加一个#include <functional>,不加怎么跑过去的。
  2. install-libpoco.sh大概第十行左右,so写成了s0.
  3. poco库问题,
libPocoCrypto.so:
	linux-vdso.so.1 (0x00007ffdf8d75000)
	libPocoFoundation.so.64 => not found
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f28501c2000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f284ffbe000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f284fdb6000)
	libssl.so.10 => not found
	libcrypto.so.10 => not found
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f284fa2d000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f284f68f000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f284f477000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f284f086000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f285061a000)
libPocoFoundation.so:
	linux-vdso.so.1 (0x00007fff0a6cd000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe34a1e1000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe349fdd000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fe349dd5000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fe349a4c000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe3496ae000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fe349496000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe3490a5000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fe34a7f6000)
libPocoJSON.so:
	linux-vdso.so.1 (0x00007fff4b068000)
	libPocoFoundation.so.64 => not found
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f019d431000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f019d22d000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f019d025000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f019cc9c000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f019c8fe000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f019c6e6000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f019c2f5000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f019d8a2000)
libPocoNet.so:
	linux-vdso.so.1 (0x00007fffdd5b6000)
	libPocoFoundation.so.64 => not found
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc2593ec000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc2591e8000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fc258fe0000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fc258c57000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc2588b9000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fc2586a1000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc2582b0000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fc259942000)
libPocoNetSSL.so:
	linux-vdso.so.1 (0x00007fff5b3ac000)
	libPocoNet.so.64 => not found
	libPocoCrypto.so.64 => not found
	libPocoUtil.so.64 => not found
	libPocoFoundation.so.64 => not found
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f58c021f000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f58c001b000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f58bfe13000)
	libssl.so.10 => not found
	libcrypto.so.10 => not found
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f58bfa8a000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f58bf6ec000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f58bf4d4000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f58bf0e3000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f58c0688000)
libPocoUtil.so:
	linux-vdso.so.1 (0x00007ffd8c1f4000)
	libPocoFoundation.so.64 => not found
	libPocoXML.so.64 => not found
	libPocoJSON.so.64 => not found
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f824ace2000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f824aade000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f824a8d6000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f824a54d000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f824a1af000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8249f97000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8249ba6000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f824b178000)
libPocoXML.so:
	linux-vdso.so.1 (0x00007fff45b7f000)
	libPocoFoundation.so.64 => not found
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0f86fd6000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0f86dd2000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f0f86bca000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0f86841000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0f864a3000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f0f8628b000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0f85e9a000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f0f87497000)

基本不能用。

LRUCache<>::Get should not return a `const ValueType&`?

  const ValueType& Get(const KeyType& key) {
    std::lock_guard<std::mutex> lock(m_mutex);
    auto it = m_entry_map.find(key);
    if (it == m_entry_map.end()) {
      throw std::range_error("No such key in cache");
    } else {
      m_entry_list.emplace_front(key, it->second->second);
      m_entry_list.erase(it->second);
      m_entry_map[key] = m_entry_list.begin();
      return m_entry_list.begin()->second;
    }
  }

Return a reference, when LRU Put is high and cache size isn't too many, might causing memory issue?

这个sdk,玩呢?

浪费我好几天时间,也没解决。资料说明不够,项目依赖繁杂(我都怀疑是不是负责人自己都没搞明白?)多了我也不说了,我就说三点。
1
// request 的构造函数中需要传入本地文件路径 qcloud_cos::PutObjectByFileReq req(bucket_name, object_name, "/path/to/local/file"); req.SetXCosStorageClass("STANDARD_IA"); // 调用 Set 方法设置元数据等 qcloud_cos::PutObjectByFileResp resp;
首页的上传示例,来个中文分号,你是怎么编译通过的(之前 也有人提到过一些低级错误)?
2
vs说用2017,别的版本呢?行还是不行。。怕是自己也没测试过吧。。
3
好多人遇到问题了,没有回复吧。。这才几个问题。。

想用qt集成,问题一堆。其他小伙伴们慎入!

好好好。你高冷。再见。

It not able to be compiled in ubuntu 20.04/22.04

d /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/build/src && /usr/bin/c++ -I/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/include -I/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include -std=c++11 -Werror -Wall -Wextra -o CMakeFiles/cossdk.dir/cos_api.cpp.o -c /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/src/cos_api.cpp
In file included from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/include/op/bucket_op.h:15,
from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/include/cos_api.h:4,
from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/src/cos_api.cpp:1:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/include/response/bucket_resp.h: In member function ‘qcloud_cos::LoggingEnabled qcloud_cos::GetBucketLoggingResp::GetLoggingEnabled() const’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/include/response/bucket_resp.h:343:53: error: implicitly-declared ‘qcloud_cos::LoggingEnabled::LoggingEnabled(const qcloud_cos::LoggingEnabled&)’ is deprecated [-Werror=deprecated-copy]
343 | LoggingEnabled GetLoggingEnabled() const { return m_rules; }
| ^~~~~~~
In file included from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/include/cos_sys_config.h:5,
from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/include/op/bucket_op.h:10,
from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/include/cos_api.h:4,
from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/src/cos_api.cpp:1:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/include/cos_defines.h:516:19: note: because ‘qcloud_cos::LoggingEnabled’ has user-provided ‘qcloud_cos::LoggingEnabled& qcloud_cos::LoggingEnabled::operator=(const qcloud_cos::LoggingEnabled&)’
516 | LoggingEnabled& operator=(const LoggingEnabled& obj) {
| ^~~~~~~~
In file included from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/Var.h:24,
from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/JSON/Array.h:23,
from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/JSON/Object.h:22,
from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/JSON/ParserImpl.h:22,
from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/JSON/Parser.h:22,
from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/include/cos_config.h:10,
from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/include/op/base_op.h:9,
from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/include/op/bucket_op.h:11,
from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/include/cos_api.h:4,
from /home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/src/cos_api.cpp:1:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = signed char; T = unsigned int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:370:3: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = signed char; T = unsigned int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:771:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const signed char’ and ‘unsigned int’ [-Werror=sign-compare]
419 | if (from > std::numeric_limits::max())
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = signed char; T = long unsigned int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:370:3: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = signed char; T = long unsigned int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:776:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const signed char’ and ‘long unsigned int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = signed char; T = long long unsigned int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:370:3: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = signed char; T = long long unsigned int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:788:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const signed char’ and ‘long long unsigned int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = short int; T = unsigned int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:370:3: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = short int; T = unsigned int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:927:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const short int’ and ‘unsigned int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = short int; T = long unsigned int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:370:3: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = short int; T = long unsigned int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:932:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const short int’ and ‘long unsigned int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = short int; T = long long unsigned int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:370:3: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = short int; T = long long unsigned int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:944:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const short int’ and ‘long long unsigned int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = int; T = unsigned int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:370:3: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = int; T = unsigned int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:1081:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const int’ and ‘unsigned int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = int; T = long unsigned int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:370:3: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = int; T = long unsigned int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:1086:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const int’ and ‘long unsigned int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = int; T = long long unsigned int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:370:3: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = int; T = long long unsigned int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:1098:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const int’ and ‘long long unsigned int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long int; T = long unsigned int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:370:3: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = long int; T = long unsigned int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:1238:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long int’ and ‘long unsigned int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long int; T = long long unsigned int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:370:3: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = long int; T = long long unsigned int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:1250:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long int’ and ‘long long unsigned int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = unsigned int; T = signed char]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:405:3: required from ‘void Poco::Dynamic::VarHolder::convertUnsignedToSigned(const F&, T&) const [with F = unsigned int; T = signed char]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:1674:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const unsigned int’ and ‘signed char’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = unsigned int; T = short int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:405:3: required from ‘void Poco::Dynamic::VarHolder::convertUnsignedToSigned(const F&, T&) const [with F = unsigned int; T = short int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:1679:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const unsigned int’ and ‘short int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = unsigned int; T = int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:405:3: required from ‘void Poco::Dynamic::VarHolder::convertUnsignedToSigned(const F&, T&) const [with F = unsigned int; T = int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:1684:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const unsigned int’ and ‘int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long unsigned int; T = signed char]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:405:3: required from ‘void Poco::Dynamic::VarHolder::convertUnsignedToSigned(const F&, T&) const [with F = long unsigned int; T = signed char]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:1826:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long unsigned int’ and ‘signed char’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long unsigned int; T = short int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:405:3: required from ‘void Poco::Dynamic::VarHolder::convertUnsignedToSigned(const F&, T&) const [with F = long unsigned int; T = short int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:1831:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long unsigned int’ and ‘short int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long unsigned int; T = int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:405:3: required from ‘void Poco::Dynamic::VarHolder::convertUnsignedToSigned(const F&, T&) const [with F = long unsigned int; T = int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:1836:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long unsigned int’ and ‘int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long unsigned int; T = long int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:405:3: required from ‘void Poco::Dynamic::VarHolder::convertUnsignedToSigned(const F&, T&) const [with F = long unsigned int; T = long int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:1841:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long unsigned int’ and ‘long int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long unsigned int; T = long long int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:405:3: required from ‘void Poco::Dynamic::VarHolder::convertUnsignedToSigned(const F&, T&) const [with F = long unsigned int; T = long long int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:1868:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long unsigned int’ and ‘long long int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long long int; T = long unsigned int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:370:3: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = long long int; T = long unsigned int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:3322:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long long int’ and ‘long unsigned int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long long int; T = long long unsigned int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:370:3: required from ‘void Poco::Dynamic::VarHolder::convertSignedToUnsigned(const F&, T&) const [with F = long long int; T = long long unsigned int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:3332:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long long int’ and ‘long long unsigned int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long long unsigned int; T = signed char]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:405:3: required from ‘void Poco::Dynamic::VarHolder::convertUnsignedToSigned(const F&, T&) const [with F = long long unsigned int; T = signed char]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:3435:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long long unsigned int’ and ‘signed char’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long long unsigned int; T = short int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:405:3: required from ‘void Poco::Dynamic::VarHolder::convertUnsignedToSigned(const F&, T&) const [with F = long long unsigned int; T = short int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:3440:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long long unsigned int’ and ‘short int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long long unsigned int; T = int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:405:3: required from ‘void Poco::Dynamic::VarHolder::convertUnsignedToSigned(const F&, T&) const [with F = long long unsigned int; T = int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:3445:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long long unsigned int’ and ‘int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long long unsigned int; T = long int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:405:3: required from ‘void Poco::Dynamic::VarHolder::convertUnsignedToSigned(const F&, T&) const [with F = long long unsigned int; T = long int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:3450:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long long unsigned int’ and ‘long int’ [-Werror=sign-compare]
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h: In instantiation of ‘void Poco::Dynamic::VarHolder::checkUpperLimit(const F&) const [with F = long long unsigned int; T = long long int]’:
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:405:3: required from ‘void Poco::Dynamic::VarHolder::convertUnsignedToSigned(const F&, T&) const [with F = long long unsigned int; T = long long int]’
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:3475:36: required from here
/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/third_party/include/Poco/Dynamic/VarHolder.h:419:12: error: comparison of integer expressions of different signedness: ‘const long long unsigned int’ and ‘long long int’ [-Werror=sign-compare]
cc1plus: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/cossdk.dir/build.make:66: src/CMakeFiles/cossdk.dir/cos_api.cpp.o] Error 1
make[2]: Leaving directory '/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/build'
make[1]: *** [CMakeFiles/Makefile2:120: src/CMakeFiles/cossdk.dir/all] Error 2
make[1]: Leaving directory '/home/ubuntu/open_source/cos-cpp-sdk-v5-5.5.4/build'
make: *** [Makefile:87: all] Error 2

rapidxml的value()返回的是const char*,不能用==直接判等字符串

3rd/cos-cpp-sdk/src/response/object_resp.cpp: In member function 'virtual bool qcloud_cos::PutLiveChannelResp::ParseFromXmlString(const string&)':
3rd/cos-cpp-sdk/src/response/object_resp.cpp:629:29: warning: comparison with string literal results in unspecified behavior [-Waddress]
3rd/cos-cpp-sdk/src/response/object_resp.cpp:641:29: warning: comparison with string literal results in unspecified behavior [-Waddress]
3rd/cos-cpp-sdk/src/response/object_resp.cpp: In member function 'virtual bool qcloud_cos::GetLiveChannelResp::ParseFromXmlString(const string&)':
3rd/cos-cpp-sdk/src/response/object_resp.cpp:685:57: warning: comparison with string literal results in unspecified behavior [-Waddress]
3rd/cos-cpp-sdk/src/response/object_resp.cpp:692:54: warning: comparison with string literal results in unspecified behavior [-Waddress]
INFO: From Compiling 3rd/cos-cpp-sdk/src/response/bucket_resp.cpp:
3rd/cos-cpp-sdk/src/response/bucket_resp.cpp: In member function 'virtual bool qcloud_cos::GetBucketObjectVersionsResp::ParseFromXmlString(const string&)':
3rd/cos-cpp-sdk/src/response/bucket_resp.cpp:639:73: warning: comparison with string literal results in unspecified behavior [-Waddress]

应该转成 std::string 再比较,或者用 strcmp 比较。

C++11 support

这个项目引用了poco库,但是poco库需要C++ 14,我们目前引用的是c++11,请问一下是否能够剔除poco库支持c++11

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.