2016-09-02 26 views
1

私はこのlinkのチュートリアルに取り組んでいます。 私はすべてのライブラリを持っており、aws-cpp-sdkがインストールされています。 私は/ usr/local/includeの中にawsフォルダを持っています。AwsStringStream.h:そのようなファイルやディレクトリはありません

When I make the cpp file, I have error as 
sudo make 
-- Configuring done 
-- Generating done 
-- Build files have been written to: /home/Softwares/Projects/S3upload/build 
[100%] Building CXX object CMakeFiles/S3upload.dir/S3upload.cpp.o 
/home/Softwares/Projects/S3upload/S3upload.cpp:4:56: fatal error: aws/core/utils/memory/stl/AwsStringStream.h: No such file or directory 
#include <aws/core/utils/memory/stl/AwsStringStream.h> 
                 ^
compilation terminated. 
make[2]: *** [CMakeFiles/S3upload.dir/S3upload.cpp.o] Error 1 
make[1]: *** [CMakeFiles/S3upload.dir/all] Error 2 
make: *** [all] Error 2 

何が間違っている可能性がありますか? 私のcppファイルは

#include <aws/s3/S3Client.h> 
#include <aws/s3/model/PutObjectRequest.h> 
#include <aws/s3/model/GetObjectRequest.h> 
#include <aws/core/utils/memory/stl/AwsStringStream.h> 

using namespace Aws::S3; 
using namespace Aws::S3::Model; 


static const char* KEY = "xxxxxxxxxxxx";//"s3_cpp_sample_key"; 
static const char* BUCKET = "xxxxxx";//"s3-cpp-sample-bucket"; 

int main() 
{ 
    S3Client client; 

    //first put an object into s3 
    PutObjectRequest putObjectRequest; 
    putObjectRequest.WithKey(KEY) 
      .WithBucket(BUCKET); 

    //this can be any arbitrary stream (e.g. fstream, stringstream etc...) 
    auto requestStream = Aws::MakeShared<Aws::StringStream>("s3-sample"); 
    *requestStream << "Hello World!"; 

    //set the stream that will be put to s3 
    putObjectRequest.SetBody(requestStream); 

    auto putObjectOutcome = client.PutObject(putObjectRequest); 

    if(putObjectOutcome.IsSuccess()) 
    { 
     std::cout << "Put object succeeded" << std::endl; 
    } 
    else 
    { 
     std::cout << "Error while putting Object " << putObjectOutcome.GetError().GetExceptionName() << 
       " " << putObjectOutcome.GetError().GetMessage() << std::endl; 
    } 


    return 0; 
} 

私のCMakeLists.txtは

​​

答えて

2

あなたは彼らが本当に正しいディレクトリにあるかどうかを確認されていますaws/core/utils/memory/stl/AwsStringStream.hが/ user/local/includeに存在することを確認してください。ファイル名は大文字と小文字が区別されます。ファイル名がAwsStringStream.hであることを確認してください。

+0

はいawsフォルダは、インストール時に/ usr/local/includeに含まれています。はい、非常に確かなファイル名はAwsStringStream.hです。 – batuman

+0

ファイル名に問題があります。私はリンクからコピーし、それは問題があります。今度はファイル名を書き換えてもエラーはなくなりました。 – batuman

0

は引用符であなたのヘッダファイルを入れてみてくださいと

関連する問題