Skip to content

aws sdk c++ doesn't compile with mingw in windows #1361

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

Closed
niusha71 opened this issue Apr 12, 2020 · 2 comments
Closed

aws sdk c++ doesn't compile with mingw in windows #1361

niusha71 opened this issue Apr 12, 2020 · 2 comments
Assignees
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. guidance Question that needs advice or information.

Comments

@niusha71
Copy link

I want to compile aws sdk c++ with mingw in windows to use it in qt project. I've error in cmake for it's thirdparty. I've searched for this problem and I found that I have to use previous aws commit which dose not have thirdparty and change some file like link. now I can cmake it with mingw by [cmake .. -G "MinGW Makefiles" -DBUILD_ONLY="s3"] but when I want to [make ] it have some errors.

What are you running the sdk on?
windows

Describe the question
make
Scanning dependencies of target aws-cpp-sdk-core
[ 0%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/AmazonSerializableWebServiceRequest.cpp.obj
[ 0%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/AmazonStreamingWebServiceRequest.cpp.obj
[ 0%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/AmazonWebServiceRequest.cpp.obj
[ 1%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/Aws.cpp.obj
[ 1%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/Globals.cpp.obj
[ 1%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/Version.cpp.obj
[ 1%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/auth/AWSAuthSigner.cpp.obj
[ 2%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/auth/AWSAuthSignerProvider.cpp.obj
[ 2%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/auth/AWSCredentialsProvider.cpp.obj
[ 2%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/auth/AWSCredentialsProviderChain.cpp.obj
[ 2%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/client/AWSClient.cpp.obj
[ 3%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/client/AWSErrorMarshaller.cpp.obj
[ 3%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/client/AsyncCallerContext.cpp.obj
[ 3%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/client/ClientConfiguration.cpp.obj
[ 3%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/client/CoreErrors.cpp.obj
[ 4%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/client/DefaultRetryStrategy.cpp.obj
[ 4%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/config/AWSProfileConfigLoader.cpp.obj[ 4%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/external/json-cpp/jsoncpp.cpp.obj
[ 4%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/external/tinyxml2/tinyxml2.cpp.obj
[ 5%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/http/HttpClient.cpp.obj
[ 5%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/http/HttpClientFactory.cpp.obj
[ 5%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/http/HttpRequest.cpp.obj
[ 5%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/http/HttpTypes.cpp.obj
[ 6%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/http/Scheme.cpp.obj
[ 6%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/http/URI.cpp.obj
[ 6%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/http/standard/StandardHttpRequest.cpp.obj
[ 6%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/http/standard/StandardHttpResponse.cpp.obj
[ 7%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/http/windows/WinConnectionPoolMgr.cpp.obj
[ 7%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/http/windows/WinHttpConnectionPoolMgr.cpp.obj
[ 7%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/http/windows/WinHttpSyncHttpClient.cpp.obj
C:\Users\98918\Documents\Niusha\aws-sdk-cpp-8f7695939b0bd87bcfea0b2ced4878afbd595b18\aws-cpp-sdk-core\source\http\windows\WinHttpSyncHttpClient.cpp: In constructor 'Aws::Http::WinHttpSyncHttpClient::WinHttpSyncHttpClient(const Aws::Client::ClientConfiguration&)':
C:\Users\98918\Documents\Niusha\aws-sdk-cpp-8f7695939b0bd87bcfea0b2ced4878afbd595b18\aws-cpp-sdk-core\source\http\windows\WinHttpSyncHttpClient.cpp:92:59: error: 'WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1' was not declared in this scope
DWORD flags = WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 | WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 | WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2;
^
C:\Users\98918\Documents\Niusha\aws-sdk-cpp-8f7695939b0bd87bcfea0b2ced4878afbd595b18\aws-cpp-sdk-core\source\http\windows\WinHttpSyncHttpClient.cpp:92:97: error: 'WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2' was not declared in this scope
DWORD flags = WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 | WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 | WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2;
^
C:\Users\98918\Documents\Niusha\aws-sdk-cpp-8f7695939b0bd87bcfea0b2ced4878afbd595b18\aws-cpp-sdk-core\source\http\windows\WinHttpSyncHttpClient.cpp: In member function 'virtual bool Aws::Http::WinHttpSyncHttpClient::DoQueryHeaders(void*, std::shared_ptrAws::Http::HttpResponse&, Aws::StringStream&, uint64_t&) const':
C:\Users\98918\Documents\Niusha\aws-sdk-cpp-8f7695939b0bd87bcfea0b2ced4878afbd595b18\aws-cpp-sdk-core\source\http\windows\WinHttpSyncHttpClient.cpp:200:30: error: NULL used in arithmetic [-Werror=pointer-arith]
if (contentTypeStr[0] != NULL)
^
C:\Users\98918\Documents\Niusha\aws-sdk-cpp-8f7695939b0bd87bcfea0b2ced4878afbd595b18\aws-cpp-sdk-core\source\http\windows\WinHttpSyncHttpClient.cpp: In member function 'virtual bool Aws::Http::WinHttpSyncHttpClient::DoSendRequest(void*) const':
C:\Users\98918\Documents\Niusha\aws-sdk-cpp-8f7695939b0bd87bcfea0b2ced4878afbd595b18\aws-cpp-sdk-core\source\http\windows\WinHttpSyncHttpClient.cpp:231:71: error: passing NULL to non-pointer argument 3 of 'WINBOOL WinHttpSendRequest(HINTERNET, LPCWSTR, DWORD, LPVOID, DWORD, DWORD, DWORD_PTR)' [-Werror=conversion-null]
return (WinHttpSendRequest(hHttpRequest, NULL, NULL, 0, 0, 0, NULL) != 0);
^
C:\Users\98918\Documents\Niusha\aws-sdk-cpp-8f7695939b0bd87bcfea0b2ced4878afbd595b18\aws-cpp-sdk-core\source\http\windows\WinHttpSyncHttpClient.cpp:231:71: error: passing NULL to non-pointer argument 7 of 'WINBOOL WinHttpSendRequest(HINTERNET, LPCWSTR, DWORD, LPVOID, DWORD, DWORD, DWORD_PTR)' [-Werror=conversion-null]
cc1plus.exe: all warnings being treated as errors
make[2]: *** [aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/http/windows/WinHttpSyncHttpClient.cpp.obj] Error 1
make[1]: *** [aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/all] Error 2
make: *** [all] Error 2

@niusha71 niusha71 added guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged. labels Apr 12, 2020
@KaibaLopez KaibaLopez self-assigned this Apr 20, 2020
@KaibaLopez KaibaLopez added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Apr 20, 2020
@KaibaLopez
Copy link
Contributor

Hi @niusha71 ,
I'm sorry for the long time this took to respond, the thing is this is kind of tricky for me to test, but after some tries and time spent on google, I think my only suggestion is...
try mingw32-make instead of make and make sure you're running from the cmd.

Again, sorry for the long time this took to respond and probably not the best answer, truth is the sdk does not "support" mingw so that complicates things, but it should still be compatible.

@KaibaLopez KaibaLopez added closing-soon This issue will automatically close in 4 days unless further comments are made. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Apr 29, 2020
@JamesReynolds
Copy link

@niusha71 Just hit this myself, if you use curl instead then the compilation can be made to succeed. Set -DENABLE_CURL_CLIENT=ON when running cmake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

3 participants