embedded platform setup help, please
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 Further information: My compiler /? output is: "Microsoft (R) C/C++ Optimizing Compiler Vers. 12.20.9518 for Hitachi SH" This compiler does support Exceptions and RTTI when you turn on the right switches (/GX and /GR, respectively), provided that you link against a library that has also been custom-built (using WinCE Platform Builder) to support these features (the default CE 4.2 SDK's lib does not). I have tried the WinCE 4.2's (limited) native C++/STL as well as STLPort -only and Dinkumware-only implementations. I get the same unresolved external in each case. Any help would be greatly appreciated. Thanks in advance, Garrett
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.
Peter Dimov wrote:
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.
Thank you. #defining BOOST_USE_WINDOWS_H solved the problem.
participants (2)
-
Garrett Weinberg
-
Peter Dimov