[
https://issues.apache.org/jira/browse/THRIFT-4759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16752238#comment-16752238
]
James E. King III commented on THRIFT-4759:
-------------------------------------------
I saw something like this when I re-tooled the cmake files so they support
BUILD_SHARED_LIB=ON on windows. I didn't have time to dig into it, so any help
you can provide would be great.
Step one - just getting a shared library for C++ to work on Windows is a good
step forward.
Step two - I would prefer to use a THRIFT_EXPORT declaration on all classes (or
standalone functions) that should be exported, keep things private/internal
from being exported, and THRIFT_EXPORT is a macro that turns into dllexport
when building the library, dllimport when consuming it, and nothing at all on
platforms other than Windows. That's how most boost repositories handle it.
In addition on linux we could go one step further than we have thus far and
disable global visibility during the build, and require annotations to get
things to become visible. I believe this is done in Boost with
BOOST_VISIBLE_SYMBOL.
> Minor missing symbol apache::thrift::GlobalOutput for Windows shared library
> build
> ----------------------------------------------------------------------------------
>
> Key: THRIFT-4759
> URL: https://issues.apache.org/jira/browse/THRIFT-4759
> Project: Thrift
> Issue Type: Improvement
> Affects Versions: 1.0
> Reporter: Mario Emmenlauer
> Priority: Trivial
>
> Current trunk has a minor problem when creating a shared library build with
> cmake on Windows with MSVC 2015 and MSVC 2017. It seems one of the symbols is
> not defined, even when
> CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS is on:
> {code:java}
> TZlibTransport.cpp.obj : error LNK2001: unresolved external symbol "class
> apache::thrift::TOutput apache::thrift::GlobalOutput"
> (?GlobalOutput@thrift@apache@@3VTOutput@12@A)
> bin\thriftzmd.dll : fatal error LNK1120: 1 unresolved externals{code}
> I don't know why this symbols fails for cmake. But if you want to go another
> route with explicitly exporting all relevant classes, and you need help to
> create a cmake-based dllimport/dllexport-integration, I can offer some help.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)