Garrett Weinberg wrote:
Hi all,
I'm trying to use a few header-only Boost libraries in an embedded environment -- to be specific, an SH4 platform that runs Windows CE.NET 4.2. My IDE is Embedded Visual C++ 4.0.
My minimal "hello world" does nothing interesting but instantiating a simple boost::shared_array of chars.
I get the following unresolved external when linking:
minimal.obj : error LNK2019: unresolved external symbol __InterlockedDecrement referenced in function "public: void __cdecl boost::detail::sp_counted_base::release(void)" (?release@sp_counted_base@detail@boost@@QAAXXZ) SH4Rel/minimal.exe : fatal error LNK1120: 1 unresolved externals
This error is caused by "boost/detail/interlocked.hpp" autodetecting _InterlockedDecrement as a compiler intrinsic, which it doesn't seem to be. If you don't use threads, you can #define BOOST_SP_DISABLE_THREADS to turn off shared_ptr's thread support; otherwise, try #defining BOOST_USE_WINDOWS_H to make Interlocked* available to shared_ptr.