HI,

the exposure of the fields was removed intentionally. The explanation can be found in the ticket you mentioned.

> What could be done to fix this situation?

If you need this functionality and are aware of the possible implications, you 
can always build your own custom library and add any special functionality you 
want. We discussed the pro's and con's of that patch and the outcome was to 
remove it from the standard library being the better choice.

The other interesting question is, why it could be an issue at all, to keep a 
private field private?

Have fun,
JensG

Am 30.10.25 um 11:03 schrieb Uilian Ries:
Greetings!

The change THRIFT-5841 (https://github.com/apache/thrift/pull/3077)
disabled a few export macros, making it impossible to expose their symbols
when generating shared libraries on Windows.

That pull request does not clarify the idea behind it, whether it was
something proposed or unexpected.

There is also a comment in the same pull request with more detailed
information about this case:
https://github.com/apache/thrift/pull/3077/files#r2466068497 :

This partially reverts #1714<https://github.com/apache/thrift/pull/1714>
and breaks building a shared library on Windows with MSVC, which is the
default configuration for the CMake scripts (as per

thrift/build/cmake/DefineOptions.cmake
<https://github.com/apache/thrift/blob/af9ac170f4de895266de4b6f9f3e68a58f113760/build/cmake/DefineOptions.cmake#L129>

Line 129 in af9ac17
<https://github.com/apache/thrift/commit/af9ac170f4de895266de4b6f9f3e68a58f113760>
set(DEFAULT_BUILD_SHARED_LIBS ON)
)

Any advice here? Apologies if this is not the best way to report this -
please let me know if there's a better channel.

The error is:

      Creating library 
C:/j/b/thrif937bd10a672f8/b/build/lib/Release/thriftnbmd.lib and object 
C:/j/b/thrif937bd10a672f8/b/build/lib/Release/thriftnbmd.exp
TNonblockingServer.obj : error LNK2019: unresolved external symbol "class 
apache::thrift::TOutput apache::thrift::GlobalOutput" 
(?GlobalOutput@thrift@apache@@3VTOutput@12@A) referenced in function "public: virtual 
__cdecl apache::thrift::server::TN
onblockingIOThread::~TNonblockingIOThread(void)" (??1TNonblockingIOThread@server@thrift@apache@@UEAA@XZ) [C:\j\b\thrif937bd10a672f8\b\build\lib\cpp\thriftnb.vcxproj] TNonblockingServerSocket.obj : error LNK2001: unresolved external symbol "class apache::thrift::TOutput apache::thrift::GlobalOutput" (?GlobalOutput@thrift@apache@@3VTOutput@12@A) [C:\j\b\thrif937bd10a672f8\b\build\lib\cpp\thriftnb.vcxproj]
C:\j\b\thrif937bd10a672f8\b\build\bin\Release\thriftnbmd.dll : fatal error 
LNK1120: 1 unresolved externals 
[C:\j\b\thrif937bd10a672f8\b\build\lib\cpp\thriftnb.vcxproj]
   Building Custom Rule C:/j/b/thrif937bd10a672f8/b/src/lib/cpp/CMakeLists.txt


Is it something expected? What could be done to fix this situation?

Regards,

Reply via email to