New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors building a hello world example using C++ SDK on OSX #1334
Comments
Hi @dblock , So, the step by step would be:
Remember to update the CMakeLists.txt to use AWSDK instead of aws-sdk-cpp, since the blog post is outdated at this point, and if you're not planning on using the whole sdk for this app I recommend adding the "-DBUILD_ONLY" with the services you're going to need (in this case s3) to make building much faster. |
I made some progress with this.
Using
then ...
|
Also what's the recommended default for the SDK? Just Feels like everything should work with defaults without any additional path options. |
yea it's outdated. |
I built and With https://github.com/dblock/aws-sdk-cpp-list-s3-buckets/blob/master/CMakeLists.txt Again, it can't find the include. How does it know to look in /usr/local/include? |
Related, #1307 |
Change the line: |
That doesn't help because the problem is at compile time, not link time. I figured some of it out, but am stuck at linking. Issue 1: missing /usr/local/include in include search pathCMake cannot find Workaround 1: Set CPLUS_INCLUDE_PATH
Workaround 2: Include in CMakeFiles.txt
Probably safe on all *nix platforms, I would recommend. Issue 2: C++ StandardThe next set of problems look like this:
We just need to enable C++ 11 extensions in CMakeFiles.txt.
Issue 3: Missing libraries at link time
Looks like my If you have a mac, you'll have all these problems @KaibaLopez. |
@dblock I do not, I have tested this in mac, windows and linux, with the default install locations as well with a custom locations, and I can run the sample code with no problems, well no problems after changing the CMakeLists.txt. I did share my CMakeLists.txt on the previous issue, so I assume it also didn't work for you. |
Well then, this fixed that. I added s3 in
This was unnecessarily time consuming. I put everything in https://github.com/dblock/aws-sdk-cpp-list-s3-buckets and can keep it up-to-date as things change. Will cut a ticket to transfer it to aws-samples. I'll go and try to make some updates to the linked issues/blog posts/docs unless someone beats me to it. |
I've PRed fixes, so closing this. Thanks for your support @KaibaLopez. |
How do I build a basic hello world example?
What platform/OS are you using?
MacOS Mojave
Which version of the SDK?
1.7.278
What compiler are you using? what version?
cmake version 3.16.4
GNU Make 3.81
Building the SDK
Downloading and building SDK works.
List S3 Buckets Sample
Trying to follow this doc or this blog post.
main.cpp
CMakeLists.txt
Reading https://aws.amazon.com/blogs/developer/using-cmake-exports-with-the-aws-sdk-for-c/ I run into missing dependencies, similar to #406.
and
Seems like that blog post is out of date and these instructions don't work. Same problem on SO.
Tried various other things. How do I fix this?
The text was updated successfully, but these errors were encountered: