You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Chris Stylianou <Ch...@borwell.com> on 2013/01/15 16:02:57 UTC

How to build thrift as a C++ dynamic library using Visual Studio Solution?

How can I build thrift as a C++ dynamic library using Visual Studio Solution, which links dynamically to other libraries (Boost, STL etc..)

For example, on a debug build, I've tried changing the project properties:
- Configuration Properties -> General -> Configuration Type = Dynamic Library (.dll)
- Configuration Properties -> C/C++ -> Code Generation -> Runtime Library = Multi-threaded DLL (/MDd)

And have disabled the BOOST_ALL_NO_LIB and BOOST_THREAD_NO_LIB defines in windows/force_in.h

But the build fails with:
LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc100-mt-gd-1_52.lib'

Which makes no sense, as 'libboost_thread-vc100-mt-gd-1_52.lib' is the static library!


If I add define BOOST_ALL_DYN_LINK in windows/force_in.h, the error I get instead is:
LINK : fatal error LNK1104: cannot open file 'boost_thread-vc100-mt-gd-1_52.lib'

Which I believe is the correct library to link to and it definitely exists.

It also emits C4251 warnings, such as:
boost\thread\win32\thread_data.hpp(99): warning C4251: 'boost::detail::thread_data_base::notify' : class 'std::vector<_Ty>' needs to have dll-interface to be used by clients of struct 'boost::detail::thread_data_base'

Any help or pointers would be very much appreciated.

Thanks
Chris