Repository navigation
Closed
Labels
bugThis issue is a bug.This issue is a bug.pending-releaseThis issue will be fixed by an approved PR that hasn't been released yet.This issue will be fixed by an approved PR that hasn't been released yet.
Description
Describe the bug
When building with following parameters to CMake:
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>
-DBUILD_ONLY=s3;s3-crt
-DBUILD_SHARED_LIBS=OFF
-DCPP_STANDARD=17
-DCUSTOM_MEMORY_MANAGEMENT=ON
-DENABLE_TESTING=OFF
-DFORCE_SHARED_CRT=OFF
-DAWS_STATIC_MSVC_RUNTIME_LIBRARY=ON
I get:
09:53:34 C:\Jws\qix-pc3-build-ws\build\aws-sdk-cpp\lib\src\aws-cpp-sdk-core\include\smithy\client\schema\JsonTraits.h(24,46): error C2220: the following warning is treated as an error [C:\Jws\qix-pc3-build-ws\build\aws-sdk-cpp\out\x64\src\aws-cpp-sdk-core\aws-cpp-sdk-core.vcxproj]
09:53:34 (compiling source file '../../../../lib/src/aws-cpp-sdk-core/source/smithy/client/schema/TraitKey.cpp')
09:53:34
09:53:34 C:\Jws\qix-pc3-build-ws\build\aws-sdk-cpp\lib\src\aws-cpp-sdk-core\include\smithy\client\schema\JsonTraits.h(24,46): warning C4275: non dll-interface class 'smithy::schema::TraitKeyBase' used as base for dll-interface class 'smithy::schema::TraitKey<smithy::schema::JsonNameTrait>' [C:\Jws\qix-pc3-build-ws\build\aws-sdk-cpp\out\x64\src\aws-cpp-sdk-core\aws-cpp-sdk-core.vcxproj]
09:53:34 (compiling source file '../../../../lib/src/aws-cpp-sdk-core/source/smithy/client/schema/TraitKey.cpp')
09:53:34 C:\Jws\qix-pc3-build-ws\build\aws-sdk-cpp\lib\src\aws-cpp-sdk-core\include\smithy\client\schema\TraitKey.h(7,18):
09:53:34 see declaration of 'smithy::schema::TraitKeyBase'
09:53:34 C:\Jws\qix-pc3-build-ws\build\aws-sdk-cpp\lib\src\aws-cpp-sdk-core\include\smithy\client\schema\JsonTraits.h(24,46):
09:53:34 see declaration of 'smithy::schema::TraitKey<smithy::schema::JsonNameTrait>'
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
It compiled in 1.11.817
Current Behavior
Build with:
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>
-DBUILD_ONLY=s3;s3-crt
-DBUILD_SHARED_LIBS=OFF
-DCPP_STANDARD=17
-DCUSTOM_MEMORY_MANAGEMENT=ON
-DENABLE_TESTING=OFF
-DFORCE_SHARED_CRT=OFF
-DAWS_STATIC_MSVC_RUNTIME_LIBRARY=ON
And you get the compilation error.
Reproduction Steps
See above.
Possible Solution
diff --git a/src/aws-cpp-sdk-core/source/smithy/client/schema/TraitKey.cpp b/src/aws-cpp-sdk-core/source/smithy/client/schema/TraitKey.cpp
index dff0c2f99..5ea4b7a27 100644
--- a/src/aws-cpp-sdk-core/source/smithy/client/schema/TraitKey.cpp
+++ b/src/aws-cpp-sdk-core/source/smithy/client/schema/TraitKey.cpp
@@ -22,7 +22,7 @@ const TraitKey<T>& TraitKey<T>::Instance() {
return instance;
}
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && defined(USE_IMPORT_EXPORT)
#define SMITHY_TEMPLATE_EXPORT __declspec(dllexport)
#else
#define SMITHY_TEMPLATE_EXPORT
--
2.49.0
Additional Information/Context
No response
AWS CPP SDK version used
1.11.895
Compiler and Version used
MSVC 19.41.34120.0
Operating System and version
Windows 11
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.pending-releaseThis issue will be fixed by an approved PR that hasn't been released yet.This issue will be fixed by an approved PR that hasn't been released yet.
Activity
sbiscigl commentedon Sep 22, 2026
confirmed reproduction and pushing out a fix, thanks for bringing this to our attention!
sbiscigl commentedon Sep 23, 2026
should be merged to main now, and released this afternoon as version
1.11.899. give it try and let me know if you see anymore issuesmagnushakansson commentedon Sep 24, 2026
It works well now. Thanks for the quick fix.
github-actions commentedon Sep 24, 2026
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.