编译升压1.47为Windows CE [英] Compile Boost 1.47 for Windows CE

查看:152
本文介绍了编译升压1.47为Windows CE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

其实是有一点关于人们试图建立为Windows CE Boost库信息在那里,但没有人给这样做所需的步骤成功报道,甚至。与两个最新版本(1.46和1.47)的发行说明也提到,他们的测试编译器之一是的Visual C ++的Windows Mobile 5,使用STLport:9.0,这似乎意味着已经取得成功(如一个侧面说明给出的编译器是有趣,因为我已经能够下载最新的STLPort的是5.2.1,我失去的东西吗?)。

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. 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?).

我发现的职位似乎围绕这里包含的文件来解决:<一href=\"http://www.boost.org/development/tests/trunk/VeecoFTC.html\">http://www.boost.org/development/tests/trunk/VeecoFTC.html.关键是,我真的不知道如何使用它。我是能够建立STLPort的为Windows CE,但是,随着Boost入门指南(<一个href=\"http://www.boost.org/doc/libs/1_47_0/more/getting_started/windows.html\">http://www.boost.org/doc/libs/1_47_0/more/getting_started/windows.html)我陷在Boost.Build阶段,我需要在这一点上配置编译CE?我只是不知道采取什么步骤,并将AP preciate一些指导。

The posts I've found seem to revolve around the file contained here: 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. Do I need to configure at this point to compile for 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. 编译STLPort的用于Windows CE(文档是pretty体面的,这并不能证明太难了)。

  2. 根据入门指南安装Boost.Build。我在这一步有点不稳,因为bootstrap.bat文件似乎是具体到ntx86和ntx86_64。难道我已经搞砸了?

在这一点上,假设我已经做正确的事情,我需要运行的东西像B2

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

我想我的生成目录是preFIX我用Boost.Build,构建类型和阶段将继续担任给出,但我不知道用什么工具集的名称。该VeecoFTC文件具有MSVC和STLport的多个条目。我删除这并不涉及到两个条目WM5,但是当我编译使用下面的命令

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. The VeecoFTC file has multiple entries for msvc and stlport. I removed the two entries that DIDN'T relate to "wm5," but when I compile with the following command

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.

实际上,该文件不存在,但has_icu_test.obj.rsp存在那里。我缺少的东西吗?难道我连在正确的轨道?

Indeed, that file does not exist, but has_icu_test.obj.rsp exists there. Am I missing something? Am I even on the right track?

更新:

既然不能得到Boost.Build工作,我得到了Boost.Build邮件列表上没有爱,我已经转移到尝试了提振的CMake构建系统:的http://gitorious.org/boost/cmake 。我与CEgcc结合使用这(我更熟悉Linux比Windows)和我遇到了以下错误:

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 . 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:

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是C的一部分,CXX flags--问题是,BOOST_PLATFORM_CONFIG不是由升压/配置/ select_platform_config.hpp定义。我应该这样被定义为Windows CE?我想这应该是升压/配置/平台/ win32.hpp(那么这将定义BOOST_HAS​​_WINTHREADS,这将解决上述错误)。版本说明如何声称这个工程select_platform_config.hpp时好像没有处理Windows CE的情况下?如果BOOST_PLATFORM_CONFIG确实需要提升是/配置/平台/ win32.hpp,那么我需要定义或者_WIN32, WIN32 或WIN32。我的第一反应是,这些都不应该被用于编译为CE。此外,VeecoFTC文件不包含任何这些。它是如何工作的?

-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. What should this be defined to for 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). How can the release notes claim this works when select_platform_config.hpp doesn't seem to handle Windows CE cases? If BOOST_PLATFORM_CONFIG does indeed need to be boost/config/platform/win32.hpp, then I need to define either _WIN32, WIN32, or WIN32. My first reaction is that none of these should be used for compiling for CE. Also, the VeecoFTC file doesn't contain any of these. How does IT work?

推荐答案

您实际上并不使用boost内部版本提振。我使用的是SCons的脚本一个项目,我需要在编译选项更多的控制内置升压的一部分。它的工作相当不错。它继续是这样的:

You don't actually have to use boost build to build boost. I built part of boost using an SCons script for a project where I needed more control over the build options. 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')

本SCons的脚本只是搜索中列出升压模块的源文件,并使用默认的编译器编译。我传递的路径,通过BOOST_SOURCE环境变量升压源目录。

This SCons script just searches for the source files in the listed boost modules and compiles with the default compiler. I pass in the path to the boost source directory via the BOOST_SOURCE environment variable.

这可以为Windows CE的工作,因为它会给你在构建过程中更多的控制。你也可以做化妆或NMAKE类似的东西。

This could work for Windows CE as it would give you more control over the build process. You could also do something similar with make or nmake.

这个故事的寓意是,建设用的bjam出升压/ B​​oostBuild并不难。

The moral of the story is that building boost with out using bjam/BoostBuild is not that hard.

这篇关于编译升压1.47为Windows CE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆