You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Carel (Jira)" <ji...@apache.org> on 2025/11/03 12:02:00 UTC
[jira] [Commented] (THRIFT-5898) Unable to build Thrift as a shared library on Windows
[ https://issues.apache.org/jira/browse/THRIFT-5898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18035031#comment-18035031 ]
Carel commented on THRIFT-5898:
-------------------------------
I will PR a proposed solution as mentioned in #3.
If there is a strong motivation to put it back as it was without changing the API I will also support that.
The reason for suggesting #3 is that even when building and linking against the static library on Windows one gets the following warning:
{code}
LINK : warning LNK4286: symbol '?GlobalOutput@thrift@apache@@3VTOutput@12@A (class apache::thrift::TOutput apache::thrift::GlobalOutput)' defined in 'thriftmd.lib(TOutput.obj)' is imported by 'my.lib(SomeCtrl.obj)' [....vcxproj]
{code}
> Unable to build Thrift as a shared library on Windows
> -----------------------------------------------------
>
> Key: THRIFT-5898
> URL: https://issues.apache.org/jira/browse/THRIFT-5898
> Project: Thrift
> Issue Type: Task
> Components: C++ - Library
> Affects Versions: 0.22.0
> Environment: Windows C++ building shared library (DLL)
> Reporter: Carel
> Assignee: Carel
> Priority: Major
>
> When trying to build the C++ library as a shared library on Windows the build fails with the following compiler error:
> {code:java}
> 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
> {code}
> This is caused by the recent change inĀ [PR#3077|https://github.com/apache/thrift/pull/3077/files] that removed the export of {{GlobalOutput}} as commented on the PR.
> Possible solutions would be:
> # Put back exporting the symbols so that the libraries can be build.
> ## Probably the least amount of effort
> ## Still requires exporting a symbol which is not normally done in a library
> # Remove the need for thrift libraries to use this symbol
> ## This takes away a feature providing visibility into runtime behaviour that can potentially be useful in debugging.
> ## Removes something from all users due to an issue on the Windows side
> # Replace the symbol with an alternative solution
> ## More invasive compared to #1
> ## Does not remove anything
> ## Changes the interface and usage which will affect external users of this interface
--
This message was sent by Atlassian Jira
(v8.20.10#820010)