-
Notifications
You must be signed in to change notification settings - Fork 1.1k
s3Client "basic_string::_M_construct" error during runtime #748
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
Comments
Code snippet? |
Sure - here is whole code: (based on [copy-paste] that example: https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/cpp/example_code/s3/list_objects.cpp )
|
And just in case - results of configure: (this time debug)
|
Ok, I think I found the issue:
inside of the file: I've changed std::getenv to GetEnvironmentVariable(...) and problem went away... GetEnvironmentVariable needs some temporary buffer and I did it in some ugly way, but it doesn't crash any longer. If it will be worth - I'll provide code snippet. |
The problem is that the code is passing a null pointer to the |
You are very right, indeed! (Shame - I was blind or too tired - 3am)
will solve an issue.
BTW - whole file "aws-cpp-sdk-core\source\platform\windows\Environment.cpp" is windows only :) |
This is what aws-cpp-sdk-core/source/platform/linux-shared/Environment.cpp does:
|
@DannyMoss I followed your advice and successfully generate the libaws-cpp-sdk-core.a and libaws-cpp-sdk-s3.a. But when I linked a small test, I got a lot of undefined references:
Can you tell me how to fix this? |
Uh oh!
There was an error while loading. Please reload this page.
What platform/OS are you using?
Windows 7 , 64bit
What compiler are you using? what version?
mingw64_7.2.0_seh
gcc version 7.2.0 (x86_64-posix-seh-rev1, Built by MinGW-W64 project)
What's your CMake arguments?
cmake -G "MinGW Makefiles" -DTARGET_ARCH="WINDOWS" -DENABLE_TESTING="OFF" -DBUILD_ONLY="s3" -DCMAKE_CXX_FLAGS="-Wa,-mbig-obj" -DCURL_LIBRARY="c:\aws_sdk\curl-7.57.0-win64-mingw\lib\libcurl.dll.a" -DCURL_INCLUDE_PATH="c:\aws_sdk\curl-7.57.0-win64-mingw\include\curl" -DCURL_INCLUDE_DIR="c:\aws_sdk\curl-7.57.0-win64-mingw\include" -DCMAKE_BUILD_TYPE=Release C:/aws_sdk/aws-sdk-cpp-master/
Other libs:
Curl: 7.57.0-win64
OpenSSL: 1.1.0g
I have to use only S3 client (upload files into S3 storage).
I've managed to build S3 client, (it didn't make tests) it produced:
libaws-cpp-sdk-core.dll
libaws-cpp-sdk-core.dll.a
libaws-cpp-sdk-s3.dll
libaws-cpp-sdk-s3.dll.a
I was able to make a test project using QT 5.9 framework, compile it and link (using same compiler) against these libs and dll's
I'm calling:
Aws::InitAPI(options);
program works fine till first attempt to create S3 client instance:
Aws::S3::S3Client s3_client(clientConfig);
then I have an error:
Any idea - why? I had to change few things in AWS sources (mostly from #45 ) to make it compilable by MinGW64. Is it blind alley?
Should I try to build S3 client in debug mode (or even static) and look for reasons or just forget about MinGW-W64?
Any help appreciated!
Cheers!
The text was updated successfully, but these errors were encountered: