基于MINGW编译阿里云aliyun-oss-cpp-sdk

Windows下基于MINGW编译aliyun-oss-cpp-sdk


注意:以下编译的都是64位版本的库,如果需要编译32位,需要将MINGW切换版本

安装CMake工具

Cmake-3.18.0 rc1 :https://github.com/Kitware/CMake/releases/download/v3.18.0-rc2/cmake-3.18.0-rc2-win64-x64.msi

安装MINGW工具

mingw-w64-v7.0.0:http://www.mingw-w64.org/doku.php/download
安装类型:x86_64-8.1.0-posix-seh-rt_v6-rev0
设置系统环境变量:
在这里插入图片描述

下载aliyun-oss-cpp-sdk

https://github.com/aliyun/aliyun-oss-cpp-sdk

编译

修改代码:
src/utils/FileSystemUtils.cc
增加如下代码:

std::string ws2s(const std::wstring &ws)
{
    size_t i;
    std::string curLocale = setlocale(LC_ALL, NULL);
    setlocale(LC_ALL, "chs");
    const wchar_t* _source = ws.c_str();
    size_t _dsize = 2 * ws.size() + 1;
    char* _dest = new char[_dsize];
    memset(_dest, 0x0, _dsize);
    wcstombs_s(&i, _dest, _dsize, _source, _dsize);
    std::string result = _dest;
    delete[] _dest;
    setlocale(LC_ALL, curLocale.c_str());
    return result;
}

修改如下代码:

std::shared_ptr<std::fstream> AlibabaCloud::OSS::GetFstreamByPath(
    const std::string& path, const std::wstring& pathw,
    std::ios_base::openmode mode)
{
#ifdef _WIN32
    if (!pathw.empty()) {
        return std::make_shared<std::fstream>(ws2s(pathw), mode);
    }
#else
    ((void)(pathw));
#endif
    return std::make_shared<std::fstream>(path, mode);
}


修改文件src/utils/ResumableBaseWorker.cc

#include <string>
#include <algorithm>
#ifdef _WIN32
#include <codecvt>
#include <locale>
#endif
#include <alibabacloud/oss/Const.h>
#include "ResumableBaseWorker.h"
#include "../utils/FileSystemUtils.h"
#include "../utils/Utils.h"

修改文件sdk/src/utils/Utils.cc

std::time_t mkgmtime64(struct tm* timeptr)
{
   std::time_t tt = mktime(timeptr);

   return tt;
}

std::time_t AlibabaCloud::OSS::UtcToUnixTime(const std::string &t)
{
    const char* date = t.c_str();
    std::tm tm;
    std::time_t tt = -1;
    int ms;
    auto result = sscanf(date, "%4d-%2d-%2dT%2d:%2d:%2d.%dZ",
        &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &ms);

    if (result == 7) {
        tm.tm_year = tm.tm_year - 1900;
        tm.tm_mon = tm.tm_mon - 1;
#ifdef _WIN32
        tt = mkgmtime64(&tm);
#else
        tt = timegm(&tm);
#endif // _WIN32
    }
    return tt < 0 ? -1 : tt;
}

修改文件CMakeLists.txt

36行增加代码:
set(HAVE__MKGMTIME64 1)

编译:

mkdir build

cd build
# mingw64位编译,如果mingw安装32位版本,则把-DCMAKE_CL_64=1去掉
cmake -DCMAKE_CL_64=1 -G "MinGW Makefiles" ..
mingw32-make.exe

在这里插入图片描述

PS D:\workspace\aliyun-oss-cpp-sdk-master\build> mingw32-make.exe
"C:\Program Files\CMake\bin\cmake.exe" -SD:\workspace\aliyun-oss-cpp-sdk-master -BD:\workspace\aliyun-oss-cpp-sdk-master\build --check-build-system CMakeFiles\Makefile.cmake 0
"C:\Program Files\CMake\bin\cmake.exe" -E cmake_progress_start D:\workspace\aliyun-oss-cpp-sdk-master\build\CMakeFiles D:\workspace\aliyun-oss-cpp-sdk-master\build\\CMakeFiles\progress.marks
C:/mingw/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/mingw32-make -s -f CMakeFiles\Makefile2 all
Scanning dependencies of target cpp-sdk
[  0%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/OssClient.cc.obj
[  1%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/OssClientImpl.cc.obj
[  1%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/OssRequest.cc.obj
[  2%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/OssResponse.cc.obj
[  2%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/OssResult.cc.obj
[  3%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/ServiceRequest.cc.obj
[  3%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/auth/Credentials.cc.obj
[  4%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/auth/CredentialsProvider.cc.obj
[  4%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/auth/HmacSha1Signer.cc.obj
[  5%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/auth/Signer.cc.obj
[  5%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/auth/SimpleCredentialsProvider.cc.obj
[  6%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/client/AsyncCallerContext.cc.obj
[  6%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/client/Client.cc.obj
[  7%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/client/ClientConfiguration.cc.obj
[  7%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/encryption/Cipher.cc.obj
[  8%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/encryption/CipherOpenssl.cc.obj
[  8%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/encryption/ContentCryptoMaterial.cc.obj
[  9%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/encryption/CryptoConfiguration.cc.obj
[  9%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/encryption/CryptoModule.cc.obj
[ 10%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/encryption/CryptoStreamBuf.cc.obj
[ 10%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/encryption/EncryptionMaterials.cc.obj
[ 11%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/encryption/OssEncryptionClient.cc.obj
[ 11%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/external/json/jsoncpp.cpp.obj
[ 12%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/external/tinyxml2/tinyxml2.cpp.obj
[ 12%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/http/CurlHttpClient.cc.obj
[ 13%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/http/HttpClient.cc.obj
[ 13%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/http/HttpMessage.cc.obj
[ 14%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/http/HttpRequest.cc.obj
[ 14%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/http/HttpResponse.cc.obj
[ 15%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/http/Url.cc.obj
[ 15%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/AbortMultipartUploadRequest.cc.obj
[ 16%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/AppendObjectRequest.cc.obj
[ 16%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/AppendObjectResult.cc.obj
[ 17%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/Bucket.cc.obj
[ 17%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/CompleteMultipartUploadRequest.cc.obj
[ 18%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/CompleteMultipartUploadResult.cc.obj
[ 18%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/CopyObjectRequest.cc.obj
[ 19%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/CopyObjectResult.cc.obj
[ 20%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/CreateBucketRequest.cc.obj
[ 20%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/CreateSelectObjectMetaRequest.cc.obj
[ 21%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/CreateSelectObjectMetaResult.cc.obj
[ 21%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/CreateSymlinkRequest.cc.obj
[ 22%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/CreateSymlinkResult.cc.obj
[ 22%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/DeleteBucketCorsRequest.cc.obj
[ 23%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/DeleteBucketEncryptionRequest.cc.obj
[ 23%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/DeleteBucketInventoryConfigurationRequest.cc.obj
[ 24%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/DeleteBucketLifecycleRequest.cc.obj
[ 24%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/DeleteBucketLoggingRequest.cc.obj
[ 25%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/DeleteBucketPolicyRequest.cc.obj
[ 25%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/DeleteBucketQosInfoRequest.cc.obj
[ 26%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/DeleteBucketTaggingRequest.cc.obj
[ 26%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/DeleteBucketWebsiteRequest.cc.obj
[ 27%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/DeleteLiveChannelRequest.cc.obj
[ 27%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/DeleteObjectResult.cc.obj
[ 28%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/DeleteObjectTaggingRequest.cc.obj
[ 28%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/DeleteObjectVersionsRequest.cc.obj
[ 29%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/DeleteObjectVersionsResult.cc.obj
[ 29%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/DeleteObjectsRequest.cc.obj
[ 30%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/DeleteObjectsResult.cc.obj
[ 30%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GeneratePresignedUrlRequest.cc.obj
[ 31%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GenerateRTMPSignedUrlRequest.cc.obj
[ 31%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketAclRequest.cc.obj
[ 32%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketAclResult.cc.obj
[ 32%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketCorsRequest.cc.obj
[ 33%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketCorsResult.cc.obj
[ 33%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketEncryptionRequest.cc.obj
[ 34%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketEncryptionResult.cc.obj
[ 34%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketInfoRequest.cc.obj
[ 35%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketInfoResult.cc.obj
[ 35%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketInventoryConfigurationRequest.cc.obj
[ 36%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketInventoryConfigurationResult.cc.obj
[ 36%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketLifecycleRequest.cc.obj
[ 37%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketLifecycleResult.cc.obj
[ 37%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketLocationRequest.cc.obj
[ 38%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketLocationResult.cc.obj
[ 38%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketLoggingRequest.cc.obj
[ 39%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketLoggingResult.cc.obj
[ 40%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketPaymentRequest.cc.obj
[ 40%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketPaymentResult.cc.obj
[ 41%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketPolicyRequest.cc.obj
[ 41%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketPolicyResult.cc.obj
[ 42%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketQosInfoRequest.cc.obj
[ 42%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketQosInfoResult.cc.obj
[ 43%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketRefererRequest.cc.obj
[ 43%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketRefererResult.cc.obj
[ 44%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketStatRequest.cc.obj
[ 44%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketStatResult.cc.obj
[ 45%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketStorageCapacityRequest.cc.obj
[ 45%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketStorageCapacityResult.cc.obj
[ 46%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketTaggingRequest.cc.obj
[ 46%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketTaggingResult.cc.obj
[ 47%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketVersioningRequest.cc.obj
[ 47%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketVersioningResult.cc.obj
[ 48%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketWebsiteRequest.cc.obj
[ 48%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetBucketWebsiteResult.cc.obj
[ 49%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetLiveChannelHistoryRequest.cc.obj
[ 49%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetLiveChannelHistoryResult.cc.obj
[ 50%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetLiveChannelInfoRequest.cc.obj
[ 50%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetLiveChannelInfoResult.cc.obj
[ 51%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetLiveChannelStatRequest.cc.obj
[ 51%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetLiveChannelStatResult.cc.obj
[ 52%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetObjectAclRequest.cc.obj
[ 52%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetObjectAclResult.cc.obj
[ 53%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetObjectByUrlRequest.cc.obj
[ 53%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetObjectMetaRequest.cc.obj
[ 54%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetObjectRequest.cc.obj
[ 54%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetObjectResult.cc.obj
[ 55%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetObjectTaggingRequest.cc.obj
[ 55%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetObjectTaggingResult.cc.obj
[ 56%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetSymlinkRequest.cc.obj
[ 56%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetSymlinkResult.cc.obj
[ 57%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetUserQosInfoRequest.cc.obj
[ 57%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetUserQosInfoResult.cc.obj
[ 58%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetVodPlaylistRequest.cc.obj
[ 58%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/GetVodPlaylistResult.cc.obj
[ 59%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/InitiateMultipartUploadRequest.cc.obj
[ 60%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/InitiateMultipartUploadResult.cc.obj
[ 60%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/InputFormat.cc.obj
[ 61%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/InventoryConfiguration.cc.obj
[ 61%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/LifecycleRule.cc.obj
[ 62%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ListBucketInventoryConfigurationsRequest.cc.obj
[ 62%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ListBucketInventoryConfigurationsResult.cc.obj
[ 63%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ListBucketsRequest.cc.obj
[ 63%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ListBucketsResult.cc.obj
[ 64%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ListLiveChannelRequest.cc.obj
[ 64%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ListLiveChannelResult.cc.obj
[ 65%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ListMultipartUploadsRequest.cc.obj
[ 65%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ListMultipartUploadsResult.cc.obj
[ 66%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ListObjectVersionsResult.cc.obj
[ 66%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ListObjectsRequest.cc.obj
[ 67%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ListObjectsResult.cc.obj
[ 67%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ListPartsRequest.cc.obj
[ 68%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ListPartsResult.cc.obj
[ 68%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ModelError.cc.obj
[ 69%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ObjectCallbackBuilder.cc.obj
[ 69%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ObjectMetaData.cc.obj
[ 70%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/OutputFormat.cc.obj
[ 70%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/PostVodPlaylistRequest.cc.obj
[ 71%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/ProcessObjectRequest.cc.obj
[ 71%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/PutLiveChannelRequest.cc.obj
[ 72%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/PutLiveChannelResult.cc.obj
[ 72%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/PutLiveChannelStatusRequest.cc.obj
[ 73%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/PutObjectByUrlRequest.cc.obj
[ 73%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/PutObjectRequest.cc.obj
[ 74%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/PutObjectResult.cc.obj
[ 74%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/RestoreObjectRequest.cc.obj
[ 75%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/RestoreObjectResult.cc.obj
[ 75%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SelectObjectRequest.cc.obj
[ 76%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetBucketAclRequest.cc.obj
[ 76%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetBucketCorsRequest.cc.obj
[ 77%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetBucketEncryptionRequest.cc.obj
[ 77%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetBucketInventoryConfigurationRequest.cc.obj
[ 78%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetBucketLifecycleRequest.cc.obj
[ 78%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetBucketLoggingRequest.cc.obj
[ 79%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetBucketPaymentRequest.cc.obj
[ 80%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetBucketPolicyRequest.cc.obj
[ 80%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetBucketQosInfoRequest.cc.obj
[ 81%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetBucketRefererRequest.cc.obj
[ 81%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetBucketStorageCapacityRequest.cc.obj
[ 82%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetBucketTaggingRequest.cc.obj
[ 82%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetBucketVersioningRequest.cc.obj
[ 83%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetBucketWebsiteRequest.cc.obj
[ 83%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetObjectAclRequest.cc.obj
[ 84%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetObjectAclResult.cc.obj
[ 84%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/SetObjectTaggingRequest.cc.obj
[ 85%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/Tagging.cc.obj
[ 85%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/UploadPartCopyRequest.cc.obj
[ 86%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/UploadPartCopyResult.cc.obj
[ 86%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/model/UploadPartRequest.cc.obj
[ 87%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/resumable/DownloadObjectRequest.cc.obj
[ 87%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/resumable/MultiCopyObjectRequest.cc.obj
[ 88%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/resumable/ResumableBaseWorker.cc.obj
[ 88%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/resumable/ResumableCopier.cc.obj
[ 89%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/resumable/ResumableDownloader.cc.obj
[ 89%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/resumable/ResumableUploader.cc.obj
[ 90%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/resumable/UploadObjectRequest.cc.obj
[ 90%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/utils/Crc32.cc.obj
[ 91%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/utils/Crc64.cc.obj
[ 91%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/utils/Executor.cc.obj
[ 92%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/utils/FileSystemUtils.cc.obj
[ 92%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/utils/LogUtils.cc.obj
[ 93%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/utils/Runnable.cc.obj
[ 93%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/utils/SignUtils.cc.obj
[ 94%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/utils/ThreadExecutor.cc.obj
[ 94%] Building CXX object sdk/CMakeFiles/cpp-sdk.dir/src/utils/Utils.cc.obj
[ 95%] Linking CXX static library ..\lib\libalibabacloud-oss-cpp-sdk.a
[ 95%] Built target cpp-sdk
Scanning dependencies of target cpp-sdk-sample
[ 95%] Building CXX object sample/CMakeFiles/cpp-sdk-sample.dir/src/Config.cc.obj
[ 96%] Building CXX object sample/CMakeFiles/cpp-sdk-sample.dir/src/Program.cc.obj
[ 96%] Building CXX object sample/CMakeFiles/cpp-sdk-sample.dir/src/service/ServiceSample.cc.obj
[ 97%] Building CXX object sample/CMakeFiles/cpp-sdk-sample.dir/src/bucket/BucketSample.cc.obj
[ 97%] Building CXX object sample/CMakeFiles/cpp-sdk-sample.dir/src/object/ObjectSample.cc.obj
[ 98%] Building CXX object sample/CMakeFiles/cpp-sdk-sample.dir/src/presignedurl/PresignedUrlSample.cc.obj
[ 98%] Building CXX object sample/CMakeFiles/cpp-sdk-sample.dir/src/LiveChannel/LiveChannelSample.cc.obj
[ 99%] Building CXX object sample/CMakeFiles/cpp-sdk-sample.dir/src/encryption/EncryptionSample.cc.obj
[100%] Linking CXX executable cpp-sdk-sample.exe

如果最后编译cpp-sdk-sample.exe时链接错误,那没有关系,是因为ssl,curl等库文件找不到,可参考如下命令手动编译,命令如下:
32位:
g++ -o test .\test.cc .\lib\libalibabacloud-oss-cpp-sdk.a -lcurl -leay32 -lssleay32 -lzlibwapi -I…\sdk\include\ -I…\third_party\include -L…\third_party\lib\Win32
64位:
g++ -o test .\test.cc .\lib\libalibabacloud-oss-cpp-sdk.a -lcurl -leay32 -lssleay32 -lzlibwapi -I…\sdk\include\ -I…\third_party\include -L…\third_party\lib\x64
修改后的阿里云OSS-CPP代码(64位):https://github.com/pengrui2009/aliyun-oss-cpp-sdk-windows

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 21
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 21
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值