为 Windows CE 编译 Boost 1.47
实际上有一些关于人们尝试为 Windows CE 构建 Boost 库的信息,但没有人报告成功,甚至没有给出这样做所需的步骤。对于两个最新版本(1.46 和 1.47),发行说明提到他们的测试编译器之一是“Visual C++,Windows Mobile 5,带有 STLport:9.0”,这似乎意味着已经取得了成功(作为旁注)给出的编译器很有趣,因为我能够下载的最新 STLPort 是 5.2.1,我是否缺少某些内容?)。
我发现的帖子似乎围绕此处包含的文件: http://www.boost.org /development/tests/trunk/VeecoFTC.html。问题是,老实说我不知道如何使用它。我能够为 Windows CE 构建 STLPort,但遵循 Boost 入门指南 (http: //www.boost.org/doc/libs/1_47_0/more/getting_started/windows.html)我陷入了 Boost.Build 阶段。我现在需要配置才能编译 CE 吗?我只是不知道要采取什么步骤,希望得到一些指导。
这些是我到目前为止所遵循的步骤:
- 为 Windows CE 编译 STLPort(文档相当不错,这并没有证明太困难)。
- 根据入门指南安装 Boost.Build。我在这一步上有点犹豫,因为 bootstrap.bat 文件似乎特定于“ntx86”和“ntx86_64”。我已经搞砸了吗?
此时,假设我已经正确完成了操作,我需要运行 b2 ,就像
b2 --build-dir=build-directory toolset=toolset-name --build-type=complete stage
我假设我的构建目录是我用于 Boost.Build 的前缀一样,构建类型和阶段将保持给定的状态,但我不这样做知道要使用什么工具集名称。 VeecoFTC 文件有多个 msvc 和 stlport 条目。我删除了与“wm5”无关的两个条目,但是当我使用以下命令进行编译时,
b2 --build-dir=C:\boost-build toolset=msvc --build-type=complete stage
我收到一堆错误,例如:
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 存在于其中。我错过了什么吗?我是否走在正确的轨道上?
更新:
由于我无法让 Boost.Build 工作,并且在 Boost.Build 邮件列表上没有得到任何喜爱,我已经开始尝试 Boost 的 CMake 构建系统:http://gitorious.org/boost/cmake。我将其与 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 是 C 和 CXX 标志的一部分 - 问题是 BOOST_PLATFORM_CONFIG 不是由 boost/config/select_platform_config.hpp 定义。对于 Windows CE 应该定义什么?我认为它应该是 boost/config/platform/win32.hpp (然后定义 BOOST_HAS_WINTHREADS,这将解决上述错误)。当 select_platform_config.hpp 似乎无法处理 Windows CE 情况时,发行说明如何声称此功能有效?如果 BOOST_PLATFORM_CONFIG 确实需要是 boost/config/platform/win32.hpp,那么我需要定义 _WIN32、WIN32 或 WIN32。我的第一反应是这些都不应该用于编译 CE。此外,VeecoFTC 文件不包含任何这些内容。 IT 是如何运作的?
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?).
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:
- Compile STLPort for Windows CE (documentation was pretty decent, this didn't prove too difficult).
- Install Boost.Build according to Getting Started Guide. I'm a little shaky on this step, since the bootstrap.bat file seems to be specific to "ntx86" and "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. 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.
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?
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 . 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 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您实际上不必使用 boost build 来构建 boost。我使用 SCons 脚本为一个需要对构建选项进行更多控制的项目构建了部分 boost。效果很好。它是这样的:
这个 SCons 脚本只是搜索列出的 boost 模块中的源文件并使用默认编译器进行编译。我通过 BOOST_SOURCE 环境变量传入 boost 源目录的路径。
这可能适用于 Windows CE,因为它可以让您更好地控制构建过程。您还可以使用 make 或 nmake 执行类似的操作。
这个故事的寓意是,在不使用 bjam/BoostBuild 的情况下构建 boost 并不难。
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:
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.
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.
The moral of the story is that building boost with out using bjam/BoostBuild is not that hard.
如果 msvc 工具集配置的工具集安装路径不正确,您会看到这种错误。我在 64 位 Windows 计算机上看到过此类错误,其中工具假定编译器安装在“C:\Program Files”中,但实际上是在“C:\Program Files (x86)”中
检查工具集配置并确保它与 SDK 的安装位置匹配。
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. 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)"
Check the tool-set configuration and make sure it matches the location of where the SDK is installed.
我已经在 x86 平台上成功编译了适用于 Windows CE 6.0 的 Boost.Thread、Boost.Regex、Boost.System、Boost.Chrono 和 Boost.Atomic。
主要工作是使 WinCE 更加符合 ANSI C。我对 STLPort 进行了一些更改,并集成了缺少的 C 函数。然后我用STLPort构建了boost。
请看我发布的以下链接:
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/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
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.
The major work was to make WinCE more ANSI C compiliant. I've changed a bit STLPort and integrated with missing C function. Then I built boost with STLPort.
Look at the following link the I posted:
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/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