我正在尝试按照https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/basic-use.html上的开发人员指南在 Ubuntu 中运行 aws-sdk-cpp 。
我所做的是:
1.安装sdk
sudo apt-get install cmake
sudo apt-get install uuid
sudo apt-get install libcurl4-openssl-dev
git clone https://github.com/aws/aws-sdk-cpp.git
cd aws-sdk-cpp
mkdir sdk_build
cd sdk_build
cmake3 .. -DBUILD_ONLY=s3
make
2.创建测试文件test.cpp
#include <iostream>
#include <aws/core/Aws.h>
using namespace std;
int main(int argc, char** argv)
{
Aws::SDKOptions options;
Aws::InitAPI(options);
//use the sdk
Aws::ShutdownAPI(options);
cout << "Hello, World!";
return 0;
}
3. 编译
g++ -o test test.cpp
然后我得到了错误:
/tmp/ccAA9bE5.o: In function `main':
test.cpp:(.text+0x34): undefined reference to `Aws::InitAPI(Aws::SDKOptions const&)'
test.cpp:(.text+0x3c): undefined reference to `Aws::ShutdownAPI(Aws::SDKOptions const&)'
collect2: error: ld returned 1 exit status
我的问题:
如何解决此问题以编译和运行 aws-sdk-cpp?我错过了任何安装步骤吗?
谢谢!