我正在研究一个IoT项目(嵌入式系统),其中多个设备与PC(Windows或Linux)/ SBC(Raspberry Pi)进行通信,然后将数据转发到AWS进行进一步处理(由某些第三方完成)。为此,我试图在Windows 10 64位PC上使用mingw-64构建aws-sdk-cpp。
我希望使用g ++,因为它将使我能够以最小的麻烦获得跨平台(i686 / x64-Windows / Linux或Raspberry Pi 3)代码。
生成失败,出现以下错误。当我使用Visual Studios 14.1(2017)为Win64进行构建时,相同的代码会完全构建。
我正在使用cmake-gui将从git克隆的源代码配置为使用Mingw-make或Visual Studio 2017 Win64(已为其创建了不同的生成文件夹)进行生成。
构建输出:
D:\aws-sdk-cpp-master\mingw-w64>mingw32-make
[ 0%] Building CXX object aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/AmazonSerializableWebServiceRequest.cpp.obj
In file included from D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSigner.h:24,
from D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceRequest.h:26,
from D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/AmazonSerializableWebServiceRequest.h:19,
from D:\aws-sdk-cpp-master\aws-cpp-sdk-core\source\AmazonSerializableWebServiceRequest.cpp:16:
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h: In constructor 'Aws::Utils::Array<T>::Array(const T*, size_t)':
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h:68:69: error: 'stdext' has not been declared
std::copy(arrayToCopy, arrayToCopy + arraySize, stdext::checked_array_iterator< T * >(m_data.get(), m_size));
^~~~~~
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h:68:103: error: expected primary-expression before '*' token
std::copy(arrayToCopy, arrayToCopy + arraySize, stdext::checked_array_iterator< T * >(m_data.get(), m_size));
^
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h:68:105: error: expected primary-expression before '>' token
std::copy(arrayToCopy, arrayToCopy + arraySize, stdext::checked_array_iterator< T * >(m_data.get(), m_size));
^
In file included from D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSigner.h:24,
from D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceRequest.h:26,
from D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/AmazonSerializableWebServiceRequest.h:19,
from D:\aws-sdk-cpp-master\aws-cpp-sdk-core\source\AmazonSerializableWebServiceRequest.cpp:16:
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h: In constructor 'Aws::Utils::Array<T>::Array(Aws::Vector<Aws::Utils::Array<T>*>&&)':
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h:96:85: error: 'stdext' has not been declared
std::copy(arr->m_data.get(), arr->m_data.get() + arraySize, stdext::checked_array_iterator< T * >(m_data.get() + location, m_size));
^~~~~~
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h:96:119: error: expected primary-expression before '*' token
std::copy(arr->m_data.get(), arr->m_data.get() + arraySize, stdext::checked_array_iterator< T * >(m_data.get() + location, m_size));
^
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h:96:121: error: expected primary-expression before '>' token
std::copy(arr->m_data.get(), arr->m_data.get() + arraySize, stdext::checked_array_iterator< T * >(m_data.get() + location, m_size));
^
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h: In copy constructor 'Aws::Utils::Array<T>::Array(const Aws::Utils::Array<T>&)':
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h:115:86: error: 'stdext' has not been declared
std::copy(other.m_data.get(), other.m_data.get() + other.m_size, stdext::checked_array_iterator< T * >(m_data.get(), m_size));
^~~~~~
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h:115:120: error: expected primary-expression before '*' token
std::copy(other.m_data.get(), other.m_data.get() + other.m_size, stdext::checked_array_iterator< T * >(m_data.get(), m_size));
^
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h:115:122: error: expected primary-expression before '>' token
std::copy(other.m_data.get(), other.m_data.get() + other.m_size, stdext::checked_array_iterator< T * >(m_data.get(), m_size));
^
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h: In member function 'Aws::Utils::Array<T>& Aws::Utils::Array<T>::operator=(const Aws::Utils::Array<T>&)':
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h:148:86: error: 'stdext' has not been declared
std::copy(other.m_data.get(), other.m_data.get() + other.m_size, stdext::checked_array_iterator< T * >(m_data.get(), m_size));
^~~~~~
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h:148:120: error: expected primary-expression before '*' token
std::copy(other.m_data.get(), other.m_data.get() + other.m_size, stdext::checked_array_iterator< T * >(m_data.get(), m_size));
^
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h:148:122: error: expected primary-expression before '>' token
std::copy(other.m_data.get(), other.m_data.get() + other.m_size, stdext::checked_array_iterator< T * >(m_data.get(), m_size));
^
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h: In instantiation of 'Aws::Utils::Array<T>::Array(Aws::Vector<Aws::Utils::Array<T>*>&&) [with T = unsigned char; Aws::Vector<Aws::Utils::Array<T>*> = std::vector<Aws::Utils::Array<unsigned char>*, Aws::Allocator<Aws::Utils::Array<unsigned char>*> >]':
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h:243:93: required from here
D:/aws-sdk-cpp-master/aws-cpp-sdk-core/include/aws/core/utils/Array.h:96:136: error: value computed is not used [-Werror=unused-value]
std::copy(arr->m_data.get(), arr->m_data.get() + arraySize, stdext::checked_array_iterator< T * >(m_data.get() + location, m_size));
cc1plus.exe: all warnings being treated as errors
mingw32-make[2]: *** [aws-cpp-sdk-core\CMakeFiles\aws-cpp-sdk-core.dir\build.make:63: aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/AmazonSerializableWebServiceRequest.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:7762: aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/all] Error 2
mingw32-make: *** [Makefile:129: all] Error 2
D:\aws-sdk-cpp-master\mingw-w64>