Problem with MSVC8.0, Shared_Ptr and SmartDevice SDK

Hi, I am trying to port some .NET classes into moder C++ and I am using shared_ptr. I am trying to compile with Visual Studio 2005 and Pocket PC 2003 SDK to target some mobile devices and when I compile I got the following : error unknown CE compiler I have modified visualc.hpp to pass this test by adding : elif _MSC_VER < 2500 //Visual 8 Pocket PC 2003 and WM5 comes with 2048 # define BOOST_COMPILER_VERSION evc4.0 but it's not enough since after I get a problem with Interlocked I think, I had to comment the following : //#elif (defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN )) // //extern "C" long __cdecl _InterlockedIncrement( long volatile * ); //extern "C" long __cdecl _InterlockedDecrement( long volatile * ); //extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long ); // //# pragma intrinsic( _InterlockedIncrement ) //# pragma intrinsic( _InterlockedDecrement ) //# pragma intrinsic( _InterlockedCompareExchange ) // //# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement //# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement //# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange Now it compiles fine under Pocket PC but it's a bad workaround, if someone could provide a real fix... First thing to do is to check which version is used with Visual Studio 8 and smart devices SDK. If I look at afxver.h it seems to be 0x0800 but not sure that it's the right place to look at. Hope it helps

Vince wrote:
Hi,
I am trying to port some .NET classes into moder C++ and I am using shared_ptr. I am trying to compile with Visual Studio 2005 and Pocket PC 2003 SDK to target some mobile devices and when I compile I got the following :
error unknown CE compiler
I have modified visualc.hpp to pass this test by adding :
elif _MSC_VER < 2500 //Visual 8 Pocket PC 2003 and WM5 comes with 2048 # define BOOST_COMPILER_VERSION evc4.0
but it's not enough since after I get a problem with Interlocked I think, I had to comment the following :
//#elif (defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN ))
[...] I believe that this has already been reported and fixed in the CVS... can you try the CVS version? You can also wait for the 1.34 release candidate but I don't know when it will become available.

On Sunday 21 May 2006 15:52, Vince wrote:
I am trying to compile with Visual Studio 2005 and Pocket PC 2003 SDK to target some mobile devices and when I compile I got the following :
error unknown CE compiler
I have modified visualc.hpp to pass this test by adding :
elif _MSC_VER < 2500 //Visual 8 Pocket PC 2003 and WM5 comes with 2048 # define BOOST_COMPILER_VERSION evc4.0
I highly doubt that number, also I object calling the compiler evc4.0 in that case. That would be a version jump from version 14 to version 25. In fact, the CE compiler versions I know are - 1200, 1201, 1202 used by eVC3 and eVC4. - Something like 13xx used by Platform Builder 5 (not sure, haven't checked that yet). - VC8 comes with version 1400.
but it's not enough since after I get a problem with Interlocked I think, I had to comment the following :
//#elif (defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN )) // //extern "C" long __cdecl _InterlockedIncrement( long volatile * ); //extern "C" long __cdecl _InterlockedDecrement( long volatile * ); //extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long ); // //# pragma intrinsic( _InterlockedIncrement ) //# pragma intrinsic( _InterlockedDecrement ) //# pragma intrinsic( _InterlockedCompareExchange ) // //# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement //# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement //# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
Now it compiles fine under Pocket PC but it's a bad workaround, if someone could provide a real fix...
The pocket PC SDK and AFAICT all SDKs generated with Platform Builder up to at least version 5 declare the Interlocked* functions without the volatile. Spiced up with the fact that some are inline assembler and some are macros this is a real mess. See the workarounds in STLport (No, the VC8 port for CE isn't completely merged into CVS HEAD yet) in order to get the picture.
First thing to do is to check which version is used with Visual Studio 8 and smart devices SDK. If I look at afxver.h it seems to be 0x0800 but not sure that it's the right place to look at.
I think the version in afxver.h is rather the version of the MFC. Also, workarounds typically need several different causes: the compiler, the standardlibrary and for CE also the SDK, i.e. the target platform. Typically, this here should do the job: #if defined(UNDER_CE) # if(_WIN32_WCE < 300) # error CE before 3.0 is probably unsupported # elif(_WIN32_WCE < 400) // CE3 # elif(_WIN32_WCE < 420) // CE 4.0 and 4.1 # elif(_WIN32_WCE < 0x500)// yes, they switched to hex with 5.0!!1! // CE 4.2 # elif(_WIN32_WCE < 0x600) // CE 5 # else # error unknown CE variant # endif #else // win32 for the desktop #endif Uli
participants (3)
-
Peter Dimov
-
Ulrich Eckhardt
-
Vince