Open xyzmultimedia opened 1 year ago
Hello @xyzmultimedia ,
Thank you very much for your submission. You seem to follow perfectly the steps from our Build the AWS SDK for C++ on Windows in the developer guide. Could you please provide the actual error message you are receiving while attempting to build in release mode?
At a first glance, this issue seems similar to this one and this one.
Could you please attempt the recommended suggestion ( defining USE_IMPORT_EXPORT
before including any SDK headers or building the SDK statically using the cmake arguments: -DFORCE_SHARED_CRT=OFF -DBUILD_SHARED_LIBS=OFF
) and let me know if one of this suggestion solves your issue or if you are still encountering the same behavior?
Best regards,
Yasmine
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.
Hi Yasmine!
Thank you for helping out. Here is the error as output and how it appears:
Exception thrown at 0x00007FF8472913EC (vcruntime140.dll) in AWS-Lambda-Invoke.exe: 0xC0000005: Access violation writing location 0x000001FE00000001.
I also see that clientConfig.region is undefined prior, not empty, which is what is causing issues.
I do have #define USE_IMPORT_EXPORT at the top of my code before any of the SDK headers, but I have been struggling trying to find a way to use the CMake arguments -DFORCE_SHARED_CRT=OFF -DBUILD_SHARED_LIBS=OFF
in a Visual Studio project. Unfortunately, because of a framework I'm in, I'm not able to CMake my project (or I lack the knowledge how to do so).
Do you know if there is a way I can pass those arguments while building using .sln and .vcxproj?
Thanks again, Jason
I am also experiencing the same issue as this.
Hello @xyzmultimedia ,
Thank you very much for your response, You can provide these CMake arguments -DFORCE_SHARED_CRT=OFF -DBUILD_SHARED_LIBS=OFF during the Step 5 shared in your reproduction steps as follow:
cmake "..\aws-sdk-cpp" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="C:/Program Files (x86)/aws-cpp-sdk-all" -DFORCE_SHARED_CRT=OFF -DBUILD_SHARED_LIBS=OFF
Unfortunately, I can't provide guidance on building the sdk using .sln and .vcxproj. For support and guidance on this you would need to contact the Microsoft team members and community contributors.
I wonder if our documentation to build our sdk examples using Visual Studio: https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/getting-started-code-examples.html might be helpful for you here.
Let me know if this helps!
Best regards,
Yasmine
Hello @JakeDCW ,
Thank you very much for reaching out. Could you please provide more context? This is a build issue:
Best regards
I am following this guide here: https://aws.amazon.com/blogs/gametech/how-to-integrate-the-aws-c-sdk-with-unreal-engine/ https://aws.amazon.com/blogs/gametech/generate-custom-game-events-from-unreal-integrated-with-the-game-analytics-pipeline/
This is with Unreal 5.2 and VS 2019 and 2022; Using vcpkg or compiling from source with CMake fails on destructor.
Both compile, but whenever you hit this step here "Replace the BeginPlay function in MyActor.cpp:" in the above link, sometimes it works (first time run) but then whenever a second run happens, there is a crash on destructor of CognitoIdentityClient related functions.
Hello @JakeDCW ,
Thank you very much for your answer. As of today, we don't officially support the use of the AWS CPP SDK with Unreal Engine. (see the feature request for Unreal Support).
This also does seem like a different issue than the one reported above so I would suggest to open a new issue with all the details related to your case specifically the full behavior experienced and reproduction steps. I see that you have commented on this issue : https://github.com/aws/aws-sdk-cpp/issues/2513 Is the behavior you experienced similar to this?
As a side note: The aws-sdk-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If you need any specific vcpkg support, please create an issue on the vcpkg repository. Best regards,
Yasmine
Hi Yasmine,
Thank you for the help! I realized some time after posting as well that I was confused about how CMake builds the static libraries, so I now built the correct static libraries and copied those over to the directory (just .libs). I also put down the path to the .libs under Linker -> General -> Additional Library Directories.
My problem now is a linker issue. With code like below (just to test my setup), I see unresolved linker issues:
#define USE_IMPORT_EXPORT
#define USE_WINDOWS_DLL_SEMANTICS
#include <aws/core/Aws.h>
int main(int argc, char** argv)
{
Aws::SDKOptions options;
Aws::InitAPI(options);
{
// make your SDK calls here.
}
Aws::ShutdownAPI(options);
return 0;
}
Results in:
Additional Library Dependencies = (source code folder) Additional Dependencies = aws-cpp-sdk-core.lib;aws-c-auth.lib;aws-c-cal.lib;aws-c-common.lib;aws-c-compression.lib;aws-c-event-stream.lib;aws-checksums.lib;aws-c-http.lib;aws-c-io.lib;aws-c-mqtt.lib;aws-crt-cpp.lib;aws-c-s3.lib;aws-c-sdkutils.lib;aws-cpp-sdk-lambda.lib;%(AdditionalDependencies)
Thanks again for the help, slow and steady progress!
I have the exact same issue as the original poster. i.e. access violation here clientConfig.region = Aws::String("us-east-2"); // xstring's Memmove failure
Did anyone find a fix? Not too sure how updating the nuget packages helps with this?
Describe the bug
Let me first start off by stating that I don't think this is a bug, but I'm missing steps to fix something. The code that I am running is below, which works in Debug configuration but not Release:
This issue has already been addressed by this Stack Overflow post (https://stackoverflow.com/questions/57157624/aws-sdk-c-code-dont-work-on-release-build), where they needed to update their packages.
However, I built my packages from CMake, and I should have the latest code on the main branch, and yet I still run into undefined behavior using xstring's memmove when trying to override the clientConfig.region. My reproduction steps for building are down below, am I missing a step?
Expected Behavior
I expect the code to work in Release Configuration as it did for Debug.
Current Behavior
Release Configuration crashes on trying to override the region by assigning a new string.
Reproduction Steps
Steps to build packages and link it to the project:
Possible Solution
I'm thinking I need to update per this post (https://stackoverflow.com/questions/57157624/aws-sdk-c-code-dont-work-on-release-build), but clearing everything, git cloning, and confirming I have the latest in the main branch using
git submodule update --init --recursive
does not fix my issue, so I need to update some other way.Additional Information/Context
No response
AWS CPP SDK version used
Latest (1.11.162)
Compiler and Version used
Visual Studio 17 2022
Operating System and version
Windows 10, Version 22H2