|
Boost : |
Subject: [boost] boost::winapi and Windows CE 7 and Windows Mobile 6
From: Vyacheslav Lanovets (sol_at_[hidden])
Date: 2018-06-07 20:04:25
Hello,
I am having big trouble migrating from 1.65.1 to 1.67 in VS2008 for CE
platform. We already have quite a few patches for boost we reapply on every
update. Boost 1.67 added more issues here and there, and among them the
winapi library.
On our old CE 7.00 I have winnt.h file where the second branch get selected.
#if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) ||
defined(_M_PPC) || defined(_M_IA64)) && !defined(MIDL_PASS)
#define DECLSPEC_IMPORT __declspec(dllimport)
#else
#define DECLSPEC_IMPORT
#endif
Therefore, WINAPI functions are not imported but is linked via corelib.lib
library.
So when I compile my code I see
3>D:\Dev\boost167\boost/winapi/semaphore.hpp(48) : error C2375:
'CreateSemaphoreW' : redefinition; different linkage
3> C:\Program Files (x86)\Windows CE
Tools\SDKs\DS-200i\include\ARMv4I\winbase.h(3189) : see declaration of
'CreateSemaphoreW'
To make things worse in Windows Mobile 6 SDK half of API is imported and
half is not (goes through corelib.lib). Visual Studio 2008 installer
includes WM6 SDK. And in the file
C:\Program Files (x86)\Windows Mobile 6
SDK\PocketPC\include\ARMV4I\winbase.h
there are functions not prefixed with WINBASEAPI.
The solution would be to have 2 new defines instead of BOOST_SYMBOL_IMPORT in
boost::winapi. On CE 7 both would be empty, on WM 6 one would be
__declspec(dllimport)
Regards,
Vyacheslav
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk