简体   繁体   English

编译用于Windows CE的Boost 1.47

[英]Compile Boost 1.47 for Windows CE

There is actually a bit of information out there about people trying to build the Boost libraries for Windows CE, but no one has reported success or even given the steps required to do so. 实际上,那里有一些关于人们试图为Windows CE构建Boost库的信息,但是没有人报告成功或什至没有这样做的必要步骤。 With the two latest releases (1.46 and 1.47) the release notes have mentioned that one of their test compilers was "Visual C++, Windows Mobile 5, with STLport: 9.0," which seems to imply that success has been achieved (as a side note the compiler given is interesting since the latest STLPort I've been able to download is 5.2.1. Am I missing something?). 在两个最新版本(1.46和1.47)中,发行说明提到其测试编译器之一是“ Visual C ++,Windows Mobile 5,带有STLport:9.0”,这似乎意味着已经取得了成功(作为旁注)由于我可以下载的最新STLPort是5.2.1,因此给出的编译器很有趣。我是否缺少某些内容?)。

The posts I've found seem to revolve around the file contained here: http://www.boost.org/development/tests/trunk/VeecoFTC.html . 我发现的帖子似乎围绕着此处包含的文件: http : //www.boost.org/development/tests/trunk/VeecoFTC.html The thing is, I honestly don't know how to use it. 问题是,老实说,我不知道如何使用它。 I was able to build STLPort for Windows CE, but following the Boost Getting Started guide ( http://www.boost.org/doc/libs/1_47_0/more/getting_started/windows.html ) I get stuck at the Boost.Build stage. 我能够为Windows CE构建STLPort,但是按照Boost入门指南( http://www.boost.org/doc/libs/1_47_0/more/getting_started/windows.html ),我陷入了Boost.Build阶段。 Do I need to configure at this point to compile for CE? 我是否需要在此时进行配置以针对CE进行编译? I just don't know what steps to take and would appreciate some guidance. 我只是不知道该采取什么步骤,不胜感激一些指导。

These are the steps I have followed so far: 到目前为止,我已经按照以下步骤进行操作:

  1. Compile STLPort for Windows CE (documentation was pretty decent, this didn't prove too difficult). 编译用于Windows CE的STLPort(文档相当不错,事实证明这并不困难)。
  2. Install Boost.Build according to Getting Started Guide. 根据入门指南安装Boost.Build。 I'm a little shaky on this step, since the bootstrap.bat file seems to be specific to "ntx86" and "ntx86_64." 我在此步骤上有点不稳定,因为bootstrap.bat文件似乎特定于“ ntx86”和“ ntx86_64”。 Have I already screwed up? 我已经搞砸了吗?

At this point, assuming I've done things correctly, I need to run b2 with something like 在这一点上,假设我做的正确,我需要使用类似

b2 --build-dir=build-directory toolset=toolset-name --build-type=complete stage

I assume my build directory is the prefix I used for Boost.Build, the build type and stage will remain as given, but I don't know what toolset name to use. 我假设我的构建目录是我用于Boost.Build的前缀,构建类型和阶段将保持不变,但是我不知道要使用什么工具集名称。 The VeecoFTC file has multiple entries for msvc and stlport. VeecoFTC文件包含msvc和stlport的多个条目。 I removed the two entries that DIDN'T relate to "wm5," but when I compile with the following command 我删除了DIDN与“ wm5”无关的两个条目,但是当我使用以下命令进行编译时

b2 --build-dir=C:\boost-build toolset=msvc --build-type=complete stage

I get a bunch of errors like: 我收到一堆错误,例如:

compile-c-c++ C:\boost-build\boost\bin.v2\libs\regex\build\msvc-9.0~wm5~stlport5.2\debug\threading-multi\has_icu_test.obj
The system cannot find the path specified.

Indeed, that file does not exist, but has_icu_test.obj.rsp exists there. 实际上,该文件不存在,但has_icu_test.obj.rsp存在于此文件中。 Am I missing something? 我想念什么吗? Am I even on the right track? 我是否在正确的轨道上?

UPDATE: 更新:

Since I can't get Boost.Build to work and am getting no love on the Boost.Build mailing list, I've moved on to trying the CMake build system for Boost: http://gitorious.org/boost/cmake . 由于我无法使Boost.Build正常工作,并且在Boost.Build邮件列表上没有得到任何支持,因此我继续尝试为Boost使用CMake构建系统: http : //gitorious.org/boost/cmake I'm using this in conjunction with CEgcc (I'm much more familiar with Linux than Windows) and I'm running into the following error: 我将其与CEgcc结合使用(我对Linux的熟悉程度远大于Windows),并且遇到了以下错误:

boost/config/requires_threads.hpp:47:5: error: #error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"

-mthreads is part of the C and CXX flags-- the problem is that BOOST_PLATFORM_CONFIG is not defined by boost/config/select_platform_config.hpp. -mthreads是C和CXX标志的一部分-问题是boost / config / select_platform_config.hpp没有定义BOOST_PLATFORM_CONFIG。 What should this be defined to for Windows CE? 对于Windows CE,这应该定义为什么? I figured it should be boost/config/platform/win32.hpp (which would then define BOOST_HAS_WINTHREADS, which would solve the above error). 我认为它应该是boost / config / platform / win32.hpp(然后将定义BOOST_HAS_WINTHREADS,这将解决上述错误)。 How can the release notes claim this works when select_platform_config.hpp doesn't seem to handle Windows CE cases? 当select_platform_config.hpp似乎无法处理Windows CE情况时,发行说明如何声称此方法有效? If BOOST_PLATFORM_CONFIG does indeed need to be boost/config/platform/win32.hpp, then I need to define either _WIN32, WIN32 , or WIN32. 如果确实需要将BOOST_PLATFORM_CONFIG设置为boost / config / platform / win32.hpp,则需要定义_WIN32, WIN32或WIN32。 My first reaction is that none of these should be used for compiling for CE. 我的第一反应是这些都不应该用于CE编译。 Also, the VeecoFTC file doesn't contain any of these. 此外,VeecoFTC文件不包含任何这些文件。 How does IT work? 它是如何工作的?

You don't actually have to use boost build to build boost. 您实际上不必使用boost build来构建boost。 I built part of boost using an SCons script for a project where I needed more control over the build options. 我使用SCons脚本为项目构建了boost的一部分,在该项目中,我需要对构建选项进行更多控制。 It worked quite well. 效果很好。 It went something like this: 它是这样的:

import os

env = Environment()

boost_source = os.environ.get('BOOST_SOURCE', None)
if not boost_source:
    raise Exception, 'BOOST_SOURCE not set'

env.Append(CPPPATH = [boost_source])

if env['PLATFORM'] == 'win32':
    env.Append(CPPDEFINES = ['BOOST_ALL_NO_LIB'])


VariantDir('build', boost_source + '/libs')

import glob
import re

for lib in ['iostreams', 'filesystem', 'system', 'regex', 'thread',
            'serialization']:
    src = []
    path = boost_source + '/libs/%s/src' % lib

    if lib == 'thread':
        if env['PLATFORM'] == 'win32':
            src.append(path + '/tss_null.cpp')
            path += '/win32'
            env.Append(CPPDEFINES = ['BOOST_HAS_WINTHREADS',
                                     'BOOST_THREAD_BUILD_LIB'])
        else: path += '/pthread'

    src += glob.glob(path + '/*.cpp')

    src = map(lambda x: re.sub(re.escape(boost_source + '/libs'), 'build', x),
              src)

    libname = 'boost_%s' % lib
    if env['PLATFORM'] == 'win32': libname = 'lib' + libname
    lib = env.Library('lib/' + libname, src)

Clean(lib, 'build')
Clean(lib, 'lib')

This SCons script just searches for the source files in the listed boost modules and compiles with the default compiler. 此SCons脚本仅在列出的boost模块中搜索源文件,并使用默认编译器进行编译。 I pass in the path to the boost source directory via the BOOST_SOURCE environment variable. 我通过BOOST_SOURCE环境变量将路径传递到boost源目录。

This could work for Windows CE as it would give you more control over the build process. 这对于Windows CE可能适用,因为它将为您提供对构建过程的更多控制。 You could also do something similar with make or nmake. 您也可以使用make或nmake做类似的事情。

The moral of the story is that building boost with out using bjam/BoostBuild is not that hard. 这个故事的寓意是,不使用bjam / BoostBuild来构建提升并不难。

I've compile with success Boost.Thread, Boost.Regex, Boost.System, Boost.Chrono and Boost.Atomic for Windows CE 6.0 on an x86 Platform. 我已经在x86平台上针对Windows CE 6.0成功编译了Boost.Thread,Boost.Regex,Boost.System,Boost.Chrono和Boost.Atomic。

The major work was to make WinCE more ANSI C compiliant. 主要工作是使WinCE更符合ANSIC。 I've changed a bit STLPort and integrated with missing C function. 我更改了一些STLPort并与缺少的C函数集成在一起。 Then I built boost with STLPort. 然后,我使用STLPort构建了Boost。

Look at the following link the I posted: 查看我发布的以下链接:

http://stackoverflow.com/questions/15906901/build-boost-c-wince http://stackoverflow.com/questions/15906901/build-boost-c-wince

http://stackoverflow.com/questions/16016637/boost-c-and-windows-ce-6-0 http://stackoverflow.com/questions/16016637/boost-c-and-windows-ce-6-0

http://stackoverflow.com/questions/15959877/windows-ce-6-0-and-runtime-link-to-debug-dll-mdd http://stackoverflow.com/questions/15959877/windows-ce-6-0-and-runtime-link-to-debug-dll-mdd

http://stackoverflow.com/questions/11079337/wince-5-0-using-stlport-void-operator-newsize-t-void-already-has-a-body/15814730#15814730 http://stackoverflow.com/questions/11079337/wince-5-0-using-stlport-void-operator-newsize-t-void-already-has-a-body/15814730#15814730

This is the sort of error you would see if the msvc tool-set configuration has an incorrect path to where the tool-set is installed. 如果msvc工具集配置的工具集安装路径不正确,则会出现这种错误。 I've seen such errors on 64-bit windows machines, where tools assume the compiler is installed in "C:\\Program Files" but it is actually in "C:\\Program Files (x86)" 我在64位Windows机器上看到过这样的错误,其中工具假定编译器安装在“ C:\\ Program Files”中,但实际上在“ C:\\ Program Files(x86)”中

Check the tool-set configuration and make sure it matches the location of where the SDK is installed. 检查工具集配置,并确保它与SDK的安装位置匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM