Search code examples
c++boostwindows-ce

Build Boost C++ WinCE


I know that are similar question but doesn't help me. I want to build boost for Windows CE 6 on an x86 Platform.

I've build STLPort in release moded as shared library for WINCE with success, I've also add some patch and integrate the OpenCE Time library and implemented some missing ANSI C function. STLPort test is ok (just an issue with wcout, wcin and wcerr in_avail() function, I don't know exactly where is the problem).

To build boost I created a batch file and change the user-config.jam in this way. The build is ok but seems that I'm compiling for my Windows Xp Platform instead of WinCE.

The boost build system is very complicated and I'm not understanding how it work (the documentation isn't very good and on google there's no much). The build of boost is ok but I cannot run application. It seems that is missing some DLL or that the Boos DLL's are wrong. The message I get when I'm attacched with debugger is "Nessun processo all'estremita' della PIPE" -> "No process at the end of the PIPE". When I try to launch the application from the target device it has no effect. Am I wrong something? How can I tell boost to use specific configuration?

Another problem is that i cannot see the build log. I don't know what exactly I'm building. Is there a way to see what actually is done?

The batch file that I call to build boost (I start the shell of Visual Studio 2008):

@echo off
cls
bjam --with-chrono --with-date_time --with-thread toolset=msvc-CEPlatformName variant=release threading=multi link=shared runtime-link=shared

This is the user-config.jam located in tools/build/v2

using msvc : CEPlatformName:
    <compileflags>-D_CRT_SECURE_NO_WARNINGS
    <compileflags>-D_CRT_SECURE_NO_DEPRECATE
    <compileflags>-DBOOST_PROTO_MAX_ARITY=10
    <compileflags>-DBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
    <compileflags>-DBOOST_MPL_LIMIT_METAFUNCTION_ARITY=10
    <compileflags>-D_WIN32_WCE=0x600
    <compileflags>-DUNDER_CE
    <compileflags>-DWINCE
    <compileflags>-Dx86
    <compileflags>-D_x86_
    <compileflags>-D_UNICODE
    <compileflags>-DUNICODE
    <linkflags>/subsystem:windowsce,6.00 
    <linkflags>/MACHINE:X86
    <linkflags>/NODEFAULTLIB:oldnames.lib
    <linkflags>/NODEFAULTLIB:libc.lib
    <linkflags>coredll.lib
    <linkflags>corelibc.lib
    <linkflags>ole32.lib
    <linkflags>oleaut32.lib
    <linkflags>uuid.lib
    <setup>C:/boost_1_53_0/CEPlatformNameConfig.bat.bat
; 


using stlport : 5.2 :
    C:/celib/stlport/stlport :
    C:/celib/stlport/bin 
;

And this is the script file for configuration

@echo off
echo CONFIGURAZIONE PER LA COMPILAZIONE DI BOOST SU WINCE
echo.

rem ------------------------------------------------------------
set BOOST_DIR=c:\boost_1_53_0\boost
set PLATFORM=CEPlatformName
set TARGETCPU=x86
set OSVERSION=WCE600
set STLPORT_DIR=C:\celib\stlport
set STLPORT_INC=%STLPORT_DIR%\stlport
set STLPORT_LIB=%STLPORT_DIR%\bin\%PLATFORM%
rem ------------------------------------------------------------

if not %1==%&TARGETCPU% goto error

echo Setting Boost directory to %BOOST_DIR%
echo Setting OS Platform to %PLATFORM%
echo Setting target CPU to %TARGETCPU%
echo Setting OS Versione to %OSVERSION%
echo Setting STLPORT_INC to %STLPORT_INC%
echo Setting STLPORT_LIB to %STLPORT_LIB%

rem settin visual studio 2008 variable path
set SDKROOT=C:\Programmi\Windows CE Tools

set PATH=%VSINSTALLDIR%\VC\ce\bin\x86_cex86;%VSINSTALLDIR%\VC\bin;%VSINSTALLDIR%\Common7\IDE;%PATH%
set PLATFORMROOT=%SDKROOT%\%OSVERSION%\%PLATFORM%
set INCLUDE=%STLPORT_INC%;%PLATFORMROOT%\include\;%PLATFORMROOT%\include\%TARGETCPU%;%VCINSTALLDIR%\ce\include;%VCINSTALLDIR%\ce\atlmfc\include;%VSInstallDir%\SmartDevices\SDK\SQL Server\Mobile\v3.0;
set LIB=%STLPORT_LIB%;%PLATFORMROOT%\lib\%TARGETCPU%;%VCINSTALLDIR%\ce\ATLMFC\LIB\%TARGETCPU%;%VCINSTALLDIR%\ce\LIB\%TARGETCPU%

echo PATH at %PATH%
echo.

echo INCLUDE is %INCLUDE%
echo.

echo LIB is %LIB%
echo.

goto exit

:error
echo Invali Target CPU
goto exit

:exit
echo impostazioni avvenute con successo

EDIT

Seems that the compileflags in the user-config.jam has no effect... or better seems that the user-config.jam has no effect

EDIT 2 I've found an issue

using msvc : CEPlatformName :
        <compileflags>-D WINCE

The issue is that this instruction does not define anything. I've also tried

using msvc : CEPlatformName :
        <compileflags>/D_CRT_SECURE_NO_WARNINGS

But the result is the same.


Solution

  • Finaly I'm able to build Boost.Thread Boost.System Boost.Chrono Boost.DateTime Boost.Regex in debug and release mode.

    The issue is according to this port (http://stackoverflow.com/questions/16016637/boost-c-and-windows-ce-6-0) that WinCe doesn't support long names. DLL name's can be larger then 32 chars.

    The same problem of name length caused this_thread::sleep_for to don't work.

    Thanks for all people the helped me.