当前位置: 首页 > news >正文

美妆网站设计模板东莞做网站的公司有哪些

美妆网站设计模板,东莞做网站的公司有哪些,dede5.7微电影网站模板,网站开发与建设方向在本文中,我们将介绍如何编译AWS SDK C库,以便在您的项目中使用。AWS SDK C库提供了与Amazon Web Services交互的接口,允许您在C应用程序中使用AWS服务。 一、准备工作 在开始编译AWS SDK C库之前,请确保您的系统已经安装了以下…

在本文中,我们将介绍如何编译AWS SDK C++库,以便在您的项目中使用。AWS SDK C++库提供了与Amazon Web Services交互的接口,允许您在C++应用程序中使用AWS服务。

一、准备工作

在开始编译AWS SDK C++库之前,请确保您的系统已经安装了以下依赖项:
CMake(版本3.13或更高版本)
支持C++11的编译器(我是使用的是MSVC 2017 64位)

二、下载AWS SDK C++源代码

首先,您需要从GitHub上的AWS SDK C++存储库下载源代码。您可以通过以下命令克隆存储库:

git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp
cd aws-sdk-cpp

三、配置编译环境

接下来,您需要使用CMake来配置编译环境。这将生成适用于您的系统的构建文件。您可以通过以下命令来配置编译环境:

mkdir <BUILD_DIR>
cd <BUILD_DIR>
# 编译Release版本
cmake ..\aws-sdk-cpp -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release -DBUILD_ONLY="s3"
# 开始编译
cmake --build . --config=Release
# 安装到指定目录,需要管理员权限
cmake --install . --config=Release

cmake --install 会把库文件安装到 C:\Program Files\aws-cpp-sdk-all 目录

四、编译测试代码验证

4.1 创建hello_s3.cpp文件

#include <aws/core/Aws.h>
#include <aws/s3/S3Client.h>
#include <iostream>
#include <aws/core/auth/AWSCredentialsProviderChain.h>
using namespace Aws;
using namespace Aws::Auth;/**  A "Hello S3" starter application which initializes an Amazon Simple Storage Service (Amazon S3) client*  and lists the Amazon S3 buckets in the selected region.**  main function**  Usage: 'hello_s3'**/int main(int argc, char **argv) {Aws::SDKOptions options;// Optionally change the log level for debugging.
//   options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug;Aws::InitAPI(options); // Should only be called once.int result = 0;{Aws::Client::ClientConfiguration clientConfig;// Optional: Set to the AWS Region (overrides config file).// clientConfig.region = "us-east-1";// You don't normally have to test that you are authenticated. But the S3 service permits anonymous requests, thus the s3Client will return "success" and 0 buckets even if you are unauthenticated, which can be confusing to a new user. auto provider = Aws::MakeShared<DefaultAWSCredentialsProviderChain>("alloc-tag");auto creds = provider->GetAWSCredentials();if (creds.IsEmpty()) {std::cerr << "Failed authentication" << std::endl;}Aws::S3::S3Client s3Client(clientConfig);auto outcome = s3Client.ListBuckets();if (!outcome.IsSuccess()) {std::cerr << "Failed with error: " << outcome.GetError() << std::endl;result = 1;} else {std::cout << "Found " << outcome.GetResult().GetBuckets().size()<< " buckets\n";for (auto &bucket: outcome.GetResult().GetBuckets()) {std::cout << bucket.GetName() << std::endl;}}}Aws::ShutdownAPI(options); // Should only be called once.return result;
}

4.2 创建CmakeLists.txt

# Set the minimum required version of CMake for this project.
cmake_minimum_required(VERSION 3.13)# Set the AWS service components used by this project.
set(SERVICE_COMPONENTS s3)# Set this project's name.
project("hello_s3")# Set the C++ standard to use to build this target.
# At least C++ 11 is required for the AWS SDK for C++.
set(CMAKE_CXX_STANDARD 11)# Use the MSVC variable to determine if this is a Windows build.
set(WINDOWS_BUILD ${MSVC})if (WINDOWS_BUILD) # Set the location where CMake can find the installed libraries for the AWS SDK.string(REPLACE ";" "/aws-cpp-sdk-all;" SYSTEM_MODULE_PATH "${CMAKE_SYSTEM_PREFIX_PATH}/aws-cpp-sdk-all")list(APPEND CMAKE_PREFIX_PATH ${SYSTEM_MODULE_PATH})
endif ()# Find the AWS SDK for C++ package.
find_package(AWSSDK REQUIRED COMPONENTS ${SERVICE_COMPONENTS})if (WINDOWS_BUILD AND AWSSDK_INSTALL_AS_SHARED_LIBS)# Copy relevant AWS SDK for C++ libraries into the current binary directory for running and debugging.# set(BIN_SUB_DIR "/Debug") # if you are building from the command line you may need to uncomment this# and set the proper subdirectory to the executables' location.AWSSDK_CPY_DYN_LIBS(SERVICE_COMPONENTS "" ${CMAKE_CURRENT_BINARY_DIR}${BIN_SUB_DIR})
endif ()add_executable(${PROJECT_NAME}hello_s3.cpp)target_link_libraries(${PROJECT_NAME}${AWSSDK_LINK_LIBRARIES})

4.3 使用cmake构建

mkdir my_project_build
cd my_project_build
cmake ../# 然后运行hello_s3
./hello_s3

hello_s3会打印出所有bucket名字,前提是已经配置了AWS的凭证。

在这里插入图片描述

http://www.zhongyajixie.com/news/15170.html

相关文章:

  • 做论坛网站看什么书优化外包哪里好
  • 杭州建设网站制作西安网约车
  • 做网站主流用什么语言网络推广员工作内容
  • 信誉好的o2o网站建设世界疫情最新数据
  • 定制化网站开发图片seo优化是什么意思
  • 网站公安备案电话号码下载app到手机上并安装
  • 邯山区建设局网站最新实时大数据
  • 做网站IP长沙seo优化首选
  • 公司网站维护建设的通知网上销售哪些平台免费
  • 网站的备案可以管几年百度权重
  • 户外广告公司seo店铺描述例子
  • 怎样建设公司网站谷歌浏览器入口
  • 重庆峰宇园林建设有限公司网站公司网站排名
  • 论坛网站制作费用青岛网络推广公司哪家好
  • 网站设计流程的步骤网络优化工程师主要负责什么工作
  • wordpress 发布站电子商务网站建设案例
  • 绍兴网站建设专业的公司自动的网站设计制作
  • 交易类网站做支付宝功能营销策划精准营销
  • 万达做的电商网站企业培训考试系统
  • 标杆网站建设百度官网入口
  • wordpress统计搜索引擎优化培训
  • 大型网站建设定制开发什么是搜索引擎优化的核心
  • 建站哪家好 discuz百度关键词查询工具免费
  • web是网站还是网页济南专业做网站
  • 搞一个网站需要多少钱网络营销公司做什么
  • 岳阳做网站的公司福建seo推广方案
  • seo优化 div css_网站架构优化网站seo优化课程
  • 如何建立自己的陕西seo快速排名
  • 汝州网站建设营销渠道的三个类型
  • 建筑网站上海市场推广和销售的区别