Comments (4)
For the stdext problem with MinGW-W64 this change in Array.h allows compilation
-#ifdef _WIN32
+#ifdef _MSC_VER
Array.txt
from aws-sdk-cpp.
To anyone interested in compiling with MinGW-W64: (7.2.0_seh):
- in "Environment.cpp" don't use std::getenv (deprecated) - rather use instead GetEnvironmentVariable If you still like to use std::getenv handle returned null pointer, ie:
Aws::String result;
char* value = std::getenv(variableName);
if(value!=NULL) result = value;
- you can use Curl 7.57.0-win64 (ie. this prebuild package)
- use rather openssl 1.1.0 not 1.0.2 (Curl package don't have all required dll's) ie: this prebuild package
from aws-sdk-cpp.
I'm also seeing the same error. I added add_definitions(-std=c++11)
to my CMakeLists.txt, and ran
aws-sdk-cpp>cmake . -G "MinGW Makefiles" -DBUILD_ONLY="aws-cpp-sdk-s3"
Following that I did
aws-sdk-cpp>mingw32-make install
and got
aws-sdk-cpp\aws-cpp-sdk-core\source\external\tinyxml2\tinyxml2.cpp:1639:15: error: definition of static data member 'Aws::External::tinyxml2::XMLDocument::_errorNames' of dllimport'd class
const char* XMLDocument::_errorNames[XML_ERROR_COUNT] = {
^
aws-cpp-sdk-core\CMakeFiles\aws-cpp-sdk-core.dir\build.make:187: recipe for target 'aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/external/tinyxml2/tinyxml2.cpp.obj' failed
mingw32-make[2]: *** [aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/external/tinyxml2/tinyxml2.cpp.obj] Error 1
CMakeFiles\Makefile2:84: recipe for target 'aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/all' failed
mingw32-make[1]: *** [aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
I am using gcc (x86_64-posix-seh-rev1, Built by MinGW-W64 project) 5.2.0
on Windows 10, 64 bit.
I am able to successfully compile the sdk using visual studio 2015 but ran into issues with stdext
when trying to integrate with mingw compiled code
from aws-sdk-cpp.
More things that I did to compile with MinGW-W64:
- Force libcurl
- When compiling aws-cpp-sdk-core
2.1. Don't use -Werror and add flag -Wa,-mbig-obj in CXX_FLAGS.
2.2. This changes:
diff --git a/aws-cpp-sdk-core/source/http/HttpClientFactory.cpp b/aws-cpp-sdk-core/source/http/HttpClientFactory.cpp
index c6864c7..111d08a 100644
--- a/aws-cpp-sdk-core/source/http/HttpClientFactory.cpp
+++ b/aws-cpp-sdk-core/source/http/HttpClientFactory.cpp
@@ -18,6 +18,9 @@
#if ENABLE_CURL_CLIENT
#include <aws/core/http/curl/CurlHttpClient.h>
#include <signal.h>
+#ifndef SIGPIPE
+#define SIGPIPE 13
+#endif
#elif ENABLE_WINDOWS_CLIENT
#include <aws/core/client/ClientConfiguration.h>
diff --git a/aws-cpp-sdk-core/source/platform/windows/Environment.cpp b/aws-cpp-sdk-core/source/platform/windows/Environment.cpp
index fd8d58f..e690def 100644
--- a/aws-cpp-sdk-core/source/platform/windows/Environment.cpp
+++ b/aws-cpp-sdk-core/source/platform/windows/Environment.cpp
@@ -29,6 +29,7 @@ that would need to be manually freed in all the client functions, just copy it i
*/
Aws::String GetEnv(const char *variableName)
{
+#ifdef _MSC_VER
char* variableValue = nullptr;
std::size_t valueSize = 0;
auto queryResult = _dupenv_s(&variableValue, &valueSize, variableName);
@@ -39,7 +40,9 @@ Aws::String GetEnv(const char *variableName)
result.assign(variableValue, valueSize - 1); // don't copy the c-string terminator byte
free(variableValue);
}
-
+#else
+ Aws::String result = std::getenv(variableName);
+#endif
return result;
}
diff --git a/aws-cpp-sdk-core/source/platform/windows/FileSystem.cpp b/aws-cpp-sdk-core/source/platform/windows/FileSystem.cpp
index c4a4850..6b15e1f 100644
--- a/aws-cpp-sdk-core/source/platform/windows/FileSystem.cpp
+++ b/aws-cpp-sdk-core/source/platform/windows/FileSystem.cpp
@@ -279,6 +279,8 @@ Aws::String CreateTempFilePath()
{
#ifdef _MSC_VER
#pragma warning(disable: 4996) // _CRT_SECURE_NO_WARNINGS
+#else
+ #define L_tmpnam_s 4095 // FIXME: Put the correct value
#endif
char s_tempName[L_tmpnam_s+1];
- When compiling other modules add -O1 and -Wa,-mbig-obj to CXX_FLAGS to avoid overflows generation obj files.
from aws-sdk-cpp.
Related Issues (20)
- Support for setting CURLSSLOPT_NATIVE_CA on Windows HOT 5
- Unresolved External Symbols when using Static Libraries HOT 9
- s2n links static version libcrypto HOT 2
- How to Specify TCP socket buffer size hints HOT 4
- Liveness / performance bug in PooledThreadExecutor HOT 3
- Windows Cmake find_package broken without AWSSDKConfigVersion.cmake HOT 5
- LNK 2001 Errors: vcpkg with Static Libraries HOT 6
- example streaming app fails with "A complete signal was sent without the preceding empty frame" HOT 5
- Aws::ShutdownAPI hangs when S3Crt is used HOT 3
- win7 system cannot upload minio issue HOT 2
- AWSAuthSignerTest tests failing on Apple Silicon build HOT 2
- Lex v2 not working (i.e. incredibly slow) on debian 12 HOT 11
- aws-sdk-cpp failed to build on vcpkg HOT 3
- Third party Build failing HOT 7
- Static ALLOCATION_TAG and SERVICE_NAME symbols break DelayLoadDLLs on windows HOT 5
- Unable to compile with gcc 13 on AMD64 HOT 2
- macOS Sonoma 14.2: Failed to connect to Cognito & Lambda endpoints (Curl error code 35) HOT 8
- fail to compile the source code (tag: 1.11.227) HOT 2
- HttpClient MakeRequest deprecated - any similar function ? HOT 3
- macOS Sonoma 14.2: Failed to connect to Cognito & Lambda endpoints (Curl error code 35 - SSL error) Reopening #2795 HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-sdk-cpp.