diff --git a/Data/ODBC/Makefile b/Data/ODBC/Makefile
index b826a79df..91721e64b 100644
--- a/Data/ODBC/Makefile
+++ b/Data/ODBC/Makefile
@@ -10,7 +10,8 @@ include ODBC.make
objects = Binder ConnectionHandle Connector EnvironmentHandle \
Extractor ODBCException ODBCMetaColumn ODBCStatementImpl \
- Parameter Preparator SessionImpl TypeInfo Unicode Utility
+ Parameter Preparator SessionImpl TypeInfo Unicode Utility \
+ Diagnostics Error
target_includes = $(POCO_BASE)/Data/testsuite/include
diff --git a/Data/ODBC/ODBC_VS90.vcproj b/Data/ODBC/ODBC_VS90.vcproj
index 820474a74..d89f10bec 100644
--- a/Data/ODBC/ODBC_VS90.vcproj
+++ b/Data/ODBC/ODBC_VS90.vcproj
@@ -635,6 +635,14 @@
RelativePath=".\src\Unicode.cpp"
>
+
+
+
+
diff --git a/Data/ODBC/ODBC_vs160.vcxproj b/Data/ODBC/ODBC_vs160.vcxproj
index 26e6baf75..f64481661 100644
--- a/Data/ODBC/ODBC_vs160.vcxproj
+++ b/Data/ODBC/ODBC_vs160.vcxproj
@@ -677,7 +677,17 @@
stdcpp17
stdc11
-
+
+ true
+ stdcpp17
+ stdc11
+
+
+ true
+ stdcpp17
+ stdc11
+
+
true
true
true
diff --git a/Data/ODBC/ODBC_vs160.vcxproj.filters b/Data/ODBC/ODBC_vs160.vcxproj.filters
index 9d9dece57..d45e49d40 100644
--- a/Data/ODBC/ODBC_vs160.vcxproj.filters
+++ b/Data/ODBC/ODBC_vs160.vcxproj.filters
@@ -122,8 +122,14 @@
ODBC\Source Files
+
+ ODBC\Source Files
+
+
+ ODBC\Source Files
+
-
\ No newline at end of file
+
diff --git a/Data/ODBC/ODBC_vs170.vcxproj b/Data/ODBC/ODBC_vs170.vcxproj
index fe8f45f54..88b06333a 100644
--- a/Data/ODBC/ODBC_vs170.vcxproj
+++ b/Data/ODBC/ODBC_vs170.vcxproj
@@ -969,7 +969,17 @@
stdcpp17
stdc11
-
+
+ true
+ stdcpp17
+ stdc11
+
+
+ true
+ stdcpp17
+ stdc11
+
+
true
true
true
@@ -1039,4 +1049,4 @@
-
\ No newline at end of file
+
diff --git a/Data/ODBC/ODBC_vs170.vcxproj.filters b/Data/ODBC/ODBC_vs170.vcxproj.filters
index 787aa3173..f4e1a162a 100644
--- a/Data/ODBC/ODBC_vs170.vcxproj.filters
+++ b/Data/ODBC/ODBC_vs170.vcxproj.filters
@@ -122,8 +122,14 @@
ODBC\Source Files
+
+ ODBC\Source Files
+
+
+ ODBC\Source Files
+
-
\ No newline at end of file
+
diff --git a/Data/ODBC/include/Poco/Data/ODBC/Diagnostics.h b/Data/ODBC/include/Poco/Data/ODBC/Diagnostics.h
index 3d2fa0496..9c58ad6be 100644
--- a/Data/ODBC/include/Poco/Data/ODBC/Diagnostics.h
+++ b/Data/ODBC/include/Poco/Data/ODBC/Diagnostics.h
@@ -19,6 +19,7 @@
#include "Poco/Data/ODBC/ODBC.h"
+#include "Poco/Data/ODBC/Utility.h"
#include
#include
#ifdef POCO_OS_FAMILY_WINDOWS
@@ -243,10 +244,19 @@ private:
// explicit instantiation definition
#ifndef POCO_DOC
-template class Diagnostics;
-template class Diagnostics;
-template class Diagnostics;
-template class Diagnostics;
+
+#if defined(POCO_OS_FAMILY_WINDOWS)
+extern template class Diagnostics;
+extern template class Diagnostics;
+extern template class Diagnostics;
+extern template class Diagnostics;
+#else
+extern template class ODBC_API Diagnostics;
+extern template class ODBC_API Diagnostics;
+extern template class ODBC_API Diagnostics;
+extern template class ODBC_API Diagnostics;
+#endif
+
#endif
diff --git a/Data/ODBC/include/Poco/Data/ODBC/Error.h b/Data/ODBC/include/Poco/Data/ODBC/Error.h
index 2be1f104e..ecdacda40 100644
--- a/Data/ODBC/include/Poco/Data/ODBC/Error.h
+++ b/Data/ODBC/include/Poco/Data/ODBC/Error.h
@@ -126,12 +126,20 @@ private:
// explicit instantiation definition
#ifndef POCO_DOC
-template class Error;
-template class Error;
-template class Error;
-template class Error;
+
+#if defined(POCO_OS_FAMILY_WINDOWS)
+extern template class Error;
+extern template class Error;
+extern template class Error;
+extern template class Error;
+#else
+extern template class ODBC_API Error;
+extern template class ODBC_API Error;
+extern template class ODBC_API Error;
+extern template class ODBC_API Error;
#endif
+#endif
using EnvironmentError = Error;
using ConnectionError = Error;
diff --git a/Data/ODBC/include/Poco/Data/ODBC/ODBCException.h b/Data/ODBC/include/Poco/Data/ODBC/ODBCException.h
index cbc9ff5bb..131bfddd0 100644
--- a/Data/ODBC/include/Poco/Data/ODBC/ODBCException.h
+++ b/Data/ODBC/include/Poco/Data/ODBC/ODBCException.h
@@ -140,10 +140,19 @@ private:
// explicit instantiation definition
#ifndef POCO_DOC
-template class HandleException;
-template class HandleException;
-template class HandleException;
-template class HandleException;
+
+#if defined(POCO_OS_FAMILY_WINDOWS)
+extern template class HandleException;
+extern template class HandleException;
+extern template class HandleException;
+extern template class HandleException;
+#else
+extern template class ODBC_API HandleException;
+extern template class ODBC_API HandleException;
+extern template class ODBC_API HandleException;
+extern template class ODBC_API HandleException;
+#endif
+
#endif
diff --git a/Data/ODBC/src/Diagnostics.cpp b/Data/ODBC/src/Diagnostics.cpp
new file mode 100644
index 000000000..0572acd82
--- /dev/null
+++ b/Data/ODBC/src/Diagnostics.cpp
@@ -0,0 +1,40 @@
+//
+// Diagnostics.cpp
+//
+// Library: Data/ODBC
+// Package: ODBC
+// Module: Diagnostics
+//
+// Copyright (c) 2025, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier: BSL-1.0
+//
+
+
+#include "Poco/Data/ODBC/Diagnostics.h"
+
+
+namespace Poco {
+namespace Data {
+namespace ODBC {
+
+// explicit instantiation definition
+#ifndef POCO_DOC
+
+#if defined(POCO_OS_FAMILY_WINDOWS)
+template class ODBC_API Diagnostics;
+template class ODBC_API Diagnostics;
+template class ODBC_API Diagnostics;
+template class ODBC_API Diagnostics;
+#else
+template class Diagnostics;
+template class Diagnostics;
+template class Diagnostics;
+template class Diagnostics;
+#endif
+
+#endif
+
+
+} } } // namespace Poco::Data::ODBC
diff --git a/Data/ODBC/src/Error.cpp b/Data/ODBC/src/Error.cpp
new file mode 100644
index 000000000..3996de6a5
--- /dev/null
+++ b/Data/ODBC/src/Error.cpp
@@ -0,0 +1,40 @@
+//
+// Error.cpp
+//
+// Library: Data/ODBC
+// Package: ODBC
+// Module: Error
+//
+// Copyright (c) 2025, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier: BSL-1.0
+//
+
+
+#include "Poco/Data/ODBC/Error.h"
+
+
+namespace Poco {
+namespace Data {
+namespace ODBC {
+
+// explicit instantiation definition
+#ifndef POCO_DOC
+
+#if defined(POCO_OS_FAMILY_WINDOWS)
+template class ODBC_API Error;
+template class ODBC_API Error;
+template class ODBC_API Error;
+template class ODBC_API Error;
+#else
+template class Error;
+template class Error;
+template class Error;
+template class Error;
+#endif
+
+#endif
+
+
+} } } // namespace Poco::Data::ODBC
diff --git a/Data/ODBC/src/ODBCException.cpp b/Data/ODBC/src/ODBCException.cpp
index a9249e4cb..d653c0174 100644
--- a/Data/ODBC/src/ODBCException.cpp
+++ b/Data/ODBC/src/ODBCException.cpp
@@ -20,6 +20,17 @@ namespace Poco {
namespace Data {
namespace ODBC {
+#if defined(POCO_OS_FAMILY_WINDOWS)
+template class ODBC_API HandleException;
+template class ODBC_API HandleException;
+template class ODBC_API HandleException;
+template class ODBC_API HandleException;
+#else
+template class HandleException;
+template class HandleException;
+template class HandleException;
+template class HandleException;
+#endif
POCO_IMPLEMENT_EXCEPTION(ODBCException, Poco::Data::DataException, "Generic ODBC error")
POCO_IMPLEMENT_EXCEPTION(InsufficientStorageException, ODBCException, "Insufficient storage error")
diff --git a/Foundation/Foundation_vs160.vcxproj b/Foundation/Foundation_vs160.vcxproj
index 3781a6677..cd0bcd025 100644
--- a/Foundation/Foundation_vs160.vcxproj
+++ b/Foundation/Foundation_vs160.vcxproj
@@ -977,8 +977,11 @@
true
true
-
-
+
+
+
+
+
true
true
true
diff --git a/Foundation/Foundation_vs170.vcxproj b/Foundation/Foundation_vs170.vcxproj
index 041e45a1e..1c268c378 100644
--- a/Foundation/Foundation_vs170.vcxproj
+++ b/Foundation/Foundation_vs170.vcxproj
@@ -1415,7 +1415,10 @@
true
true
-
+
+
+
+
true
true
diff --git a/Foundation/Makefile b/Foundation/Makefile
index 3e07a06d3..e9ff26a1b 100644
--- a/Foundation/Makefile
+++ b/Foundation/Makefile
@@ -34,7 +34,8 @@ objects = ArchiveStrategy Ascii ASCIIEncoding AsyncChannel AsyncNotificationCent
FileStreamFactory URIStreamFactory URIStreamOpener UTF32Encoding UTF16Encoding UTF8Encoding UTF8String \
Unicode UnicodeConverter Windows1250Encoding Windows1251Encoding Windows1252Encoding \
UUID UUIDGenerator Void Var VarHolder VarIterator VarVisitor Format Pipe PipeImpl PipeStream SharedMemory \
- MemoryStream FileStream AtomicCounter DataURIStream DataURIStreamFactory FileStreamRWLock
+ MemoryStream FileStream AtomicCounter DataURIStream DataURIStreamFactory FileStreamRWLock \
+ BufferedBidirectionalStreamBuf BufferedStreamBuf UnbufferedStreamBuf
zlib_objects = adler32 compress crc32 deflate \
infback inffast inflate inftrees trees zutil
diff --git a/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h b/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h
index abb5b6709..033467d48 100644
--- a/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h
+++ b/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h
@@ -181,15 +181,14 @@ private:
//
// We provide an instantiation for char.
//
-// Visual C++ needs a workaround - explicitly importing the template
-// instantiation - to avoid duplicate symbols due to multiple
-// instantiations in different libraries.
-//
-#if defined(_MSC_VER) && defined(POCO_DLL) && !defined(Foundation_EXPORTS)
-template class Foundation_API BasicBufferedBidirectionalStreamBuf>;
+
+#if defined(POCO_OS_FAMILY_WINDOWS)
+extern template class BasicBufferedBidirectionalStreamBuf>;
+#else
+extern template class Foundation_API BasicBufferedBidirectionalStreamBuf>;
#endif
-using BufferedBidirectionalStreamBuf
- = BasicBufferedBidirectionalStreamBuf>;
+
+using BufferedBidirectionalStreamBuf = BasicBufferedBidirectionalStreamBuf>;
} // namespace Poco
diff --git a/Foundation/include/Poco/BufferedStreamBuf.h b/Foundation/include/Poco/BufferedStreamBuf.h
index 2c64a9f99..de915675b 100644
--- a/Foundation/include/Poco/BufferedStreamBuf.h
+++ b/Foundation/include/Poco/BufferedStreamBuf.h
@@ -160,18 +160,17 @@ private:
BasicBufferedStreamBuf& operator = (const BasicBufferedStreamBuf&);
};
-
//
// We provide an instantiation for char.
//
-// Visual C++ needs a workaround - explicitly importing the template
-// instantiation - to avoid duplicate symbols due to multiple
-// instantiations in different libraries.
-//
-#if defined(_MSC_VER) && defined(POCO_DLL) && !defined(Foundation_EXPORTS)
-template class Foundation_API BasicBufferedStreamBuf>;
+
+#if defined(POCO_OS_FAMILY_WINDOWS)
+extern template class BasicBufferedStreamBuf>;
+#else
+extern template class Foundation_API BasicBufferedStreamBuf>;
#endif
-typedef BasicBufferedStreamBuf> BufferedStreamBuf;
+
+using BufferedStreamBuf = BasicBufferedStreamBuf>;
} // namespace Poco
diff --git a/Foundation/include/Poco/UnbufferedStreamBuf.h b/Foundation/include/Poco/UnbufferedStreamBuf.h
index 15eea4daf..2c1437976 100644
--- a/Foundation/include/Poco/UnbufferedStreamBuf.h
+++ b/Foundation/include/Poco/UnbufferedStreamBuf.h
@@ -163,15 +163,14 @@ private:
//
// We provide an instantiation for char.
//
-// Visual C++ needs a workaround - explicitly importing the template
-// instantiation - to avoid duplicate symbols due to multiple
-// instantiations in different libraries.
-//
-#if defined(_MSC_VER) && defined(POCO_DLL) && !defined(Foundation_EXPORTS)
-template class Foundation_API BasicUnbufferedStreamBuf>;
-#endif
-typedef BasicUnbufferedStreamBuf> UnbufferedStreamBuf;
+#if defined(POCO_OS_FAMILY_WINDOWS)
+extern template class BasicUnbufferedStreamBuf>;
+#else
+extern template class Foundation_API BasicUnbufferedStreamBuf>;
+#endif
+
+using UnbufferedStreamBuf = BasicUnbufferedStreamBuf>;
} // namespace Poco
diff --git a/Foundation/src/BufferedBidirectionalStreamBuf.cpp b/Foundation/src/BufferedBidirectionalStreamBuf.cpp
new file mode 100644
index 000000000..625728a98
--- /dev/null
+++ b/Foundation/src/BufferedBidirectionalStreamBuf.cpp
@@ -0,0 +1,25 @@
+//
+// BufferedBidirectionalStreamBuf.cpp
+//
+// Library: Foundation
+// Package: Streams
+// Module: StreamBuf
+//
+// Copyright (c) 2025, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier: BSL-1.0
+//
+
+
+#include "Poco/BufferedBidirectionalStreamBuf.h"
+
+namespace Poco {
+
+#if defined(POCO_OS_FAMILY_WINDOWS)
+template class Foundation_API BasicBufferedBidirectionalStreamBuf>;
+#else
+template class BasicBufferedBidirectionalStreamBuf>;
+#endif
+
+}
diff --git a/Foundation/src/BufferedStreamBuf.cpp b/Foundation/src/BufferedStreamBuf.cpp
new file mode 100644
index 000000000..e83d85a82
--- /dev/null
+++ b/Foundation/src/BufferedStreamBuf.cpp
@@ -0,0 +1,25 @@
+//
+// BufferedStreamBuf.cpp
+//
+// Library: Foundation
+// Package: Streams
+// Module: StreamBuf
+//
+// Copyright (c) 2025, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier: BSL-1.0
+//
+
+
+#include "Poco/BufferedStreamBuf.h"
+
+namespace Poco {
+
+#if defined(POCO_OS_FAMILY_WINDOWS)
+template class Foundation_API BasicBufferedStreamBuf>;
+#else
+template class BasicBufferedStreamBuf>;
+#endif
+
+}
diff --git a/Foundation/src/FileStream.cpp b/Foundation/src/FileStream.cpp
index f9bc006fd..48323f7da 100644
--- a/Foundation/src/FileStream.cpp
+++ b/Foundation/src/FileStream.cpp
@@ -13,7 +13,6 @@
#include "Poco/FileStream.h"
-#include "Poco/Exception.h"
#if defined(POCO_OS_FAMILY_WINDOWS)
#include "FileStream_WIN32.cpp"
#else
diff --git a/Foundation/src/UnbufferedStreamBuf.cpp b/Foundation/src/UnbufferedStreamBuf.cpp
new file mode 100644
index 000000000..89e577b08
--- /dev/null
+++ b/Foundation/src/UnbufferedStreamBuf.cpp
@@ -0,0 +1,25 @@
+//
+// UnbufferedStreamBuf.cpp
+//
+// Library: Foundation
+// Package: Streams
+// Module: StreamBuf
+//
+// Copyright (c) 2025, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier: BSL-1.0
+//
+
+
+#include "Poco/UnbufferedStreamBuf.h"
+
+namespace Poco {
+
+#if defined(POCO_OS_FAMILY_WINDOWS)
+template class Foundation_API BasicUnbufferedStreamBuf>;
+#else
+template class BasicUnbufferedStreamBuf>;
+#endif
+
+}