Can not compile transcribe with CURL support with Visual Studio 2022
rventuri76 opened this issue · 3 comments
Describe the bug
Hi I’m trying to compile cpp SDK on widows with CURL to get transcribe api to work with http2.
I’m following this documentation:
https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/setup-windows.html
I have Visual studio 2022 community edition and I tried using cmake 3.21 as well as cmake included and i got errors in the step 6 when i have to run “cmake --build . --config=Debug”
The error is the following:
C:\DATA\DEV\aws-sdk-build\aws-sdk-cpp\src\aws-cpp-sdk-core\source\http\curl\CurlHttpClient.cpp(97,5): error C3861: 'memset_s': identifier not found [
C:\DATA\DEV\aws-sdk-build\build\src\aws-cpp-sdk-core\aws-cpp-sdk-core.vcxproj]
I tried to change the source code of CurlHttpClient and force it to use memset
then i got this other error:
C:\DATA\DEV\aws-sdk-build\aws-sdk-cpp\src\aws-cpp-sdk-core\source\http\curl\CurlHttpClient.cpp(378,51): error C2220: the following warning is treated
as an error [C:\DATA\DEV\aws-sdk-build\build\src\aws-cpp-sdk-core\aws-cpp-sdk-core.vcxproj]
C:\DATA\DEV\aws-sdk-build\aws-sdk-cpp\src\aws-cpp-sdk-core\source\http\curl\CurlHttpClient.cpp(378,51): warning C4459: declaration of 'offset' hides
global declaration [C:\DATA\DEV\aws-sdk-build\build\src\aws-cpp-sdk-core\aws-cpp-sdk-core.vcxproj]
C:\DATA\DEV\aws-sdk-build\aws-sdk-cpp\src\aws-cpp-sdk-core\source\http\curl\CurlHttpClient.cpp(32,15): message : see declaration of 'offset' [C:\DATA
\DEV\aws-sdk-build\build\src\aws-cpp-sdk-core\aws-cpp-sdk-core.vcxproj]
fix that as well and finally got into this:
Building Custom Rule C:/DATA/DEV/aws-sdk-build/aws-sdk-cpp/generated/src/aws-cpp-sdk-textract/CMakeLists.txt
ub_TEXTRACT.cpp
Creating library C:/DATA/DEV/aws-sdk-build/build/generated/src/aws-cpp-sdk-textract/Debug/aws-cpp-sdk-textract.lib and object C:/DATA/DEV/aws-sd
k-build/build/generated/src/aws-cpp-sdk-textract/Debug/aws-cpp-sdk-textract.exp
aws-cpp-sdk-textract.vcxproj -> C:\DATA\DEV\aws-sdk-build\build\bin\Debug\aws-cpp-sdk-textract.dll
Building Custom Rule C:/DATA/DEV/aws-sdk-build/aws-sdk-cpp/generated/tests/textract-gen-tests/CMakeLists.txt
RunTests.cpp
TextractEndpointProviderTests.cpp
textract-gen-tests.vcxproj -> C:\DATA\DEV\aws-sdk-build\build\bin\Debug\textract-gen-tests.exe
Exit code 0xc0000135
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: The command "set
local [C:\DATA\DEV\aws-sdk-build\build\generated\tests\textract-gen-tests\textract-gen-tests.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: "C:\Program File
s\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E env LD_LIBRARY_PATH=: C:/DATA/DEV/aws-s
dk-build/build/bin/Debug/textract-gen-tests.exe --gtest_brief=1 [C:\DATA\DEV\aws-sdk-build\build\generated\tests\textract-gen-tests\textract-gen-test
s.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: if %errorlevel%
neq 0 goto :cmEnd [C:\DATA\DEV\aws-sdk-build\build\generated\tests\textract-gen-tests\textract-gen-tests.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmEnd [C:\DATA\
DEV\aws-sdk-build\build\generated\tests\textract-gen-tests\textract-gen-tests.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: endlocal & call
:cmErrorLevel %errorlevel% & goto :cmDone [C:\DATA\DEV\aws-sdk-build\build\generated\tests\textract-gen-tests\textract-gen-tests.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmErrorLevel [C
:\DATA\DEV\aws-sdk-build\build\generated\tests\textract-gen-tests\textract-gen-tests.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: exit /b %1 [C:\D
ATA\DEV\aws-sdk-build\build\generated\tests\textract-gen-tests\textract-gen-tests.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmDone [C:\DATA
\DEV\aws-sdk-build\build\generated\tests\textract-gen-tests\textract-gen-tests.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: if %errorlevel%
neq 0 goto :VCEnd [C:\DATA\DEV\aws-sdk-build\build\generated\tests\textract-gen-tests\textract-gen-tests.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :VCEnd" exited w
ith code 1. [C:\DATA\DEV\aws-sdk-build\build\generated\tests\textract-gen-tests\textract-gen-tests.vcxproj]
Expected Behavior
have the sdk compiled successfully with CURL support
Current Behavior
Some compilation errors and a general failure
Reproduction Steps
cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_ONLY=transcribe;transcribestreaming -DCUSTOM_MEMORY_MANAGEMENT=ON -DFORCE_CURL=ON -DCURL_INCLUDE_DIR="C:/DATA/TOOLS/curl/include" -DCURL_LIBRARY="C:/DATA/TOOLS/curl/lib/libcurl.dll.a"s -DCMAKE_INSTALL_PREFIX="%SDK_INSTALL_DIR%"
cmake --build . --config=Debug
Possible Solution
maybe:
- using memset instead of memset_s in src\aws-cpp-sdk-core\source\http\curl\CurlHttpClient.cpp(97,5)
- rename params offset at src\aws-cpp-sdk-core\source\http\curl\CurlHttpClient.cpp(387) as it conflicts with what defined at line 32
- disable testing
Additional Information/Context
No response
AWS CPP SDK version used
1.11.263
Compiler and Version used
Visual Studio 2022 Community
Operating System and version
Windows server 2022
Thanks for the detailed issue and repro steps. I can reproduce almost exactly what you are seeing on each step. Looking into what might be causing the final error.
I'm working on making a guide for how to build this sdk in visual studio. Can you change the CMake parameters to match what you have above and see if you can get it working?
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.