编译升压时出错
我正在尝试使用 Visual Studio 2008 和 STLPort 5.2.1 为 x86 Windows CE 编译 Boost 1.47。我可以成功编译 x86 Windows 和 ARMV4I Windows Mobile 6.5。
当我运行 bjam 时,我在大多数模块中都会遇到此错误:
stlport\ctype.h(42) : fatal error C1083: Cannot open include file: '../1/ctype.h': No such file or directory
STLPort 的 ctype.h 中错误引用的代码行是:
#include _STLP_NATIVE_C_HEADER(ctype.h)
如果我创建一个新的 Visual Studio 项目并添加以下行:
#define STR1(x) #x
#define STRINGIZE(x) STR1(x)
#pragma message (STRINGIZE(_STLP_NATIVE_C_HEADER(ctype.h)))
我看到: ../X86/ctype.h> 正如我所期望的。
为什么 boost 将“X86”替换为“1”?为 ARMV4I Windows Mobile 或 x86 Windows 编译时不存在此问题。
编辑
更多信息。有些东西是故意在“X86”上进行字符串替换的。
在 stlport\stl\config_evc.h 中,我向此代码添加了 pragma message:
# if !defined (_STLP_NATIVE_INCLUDE_PATH)
# if defined (_X86_)
# if defined (_STLP_WCE_TARGET_PROC_SUBTYPE_EMULATOR)
# define _STLP_NATIVE_INCLUDE_PATH ../Emulator
# else
# define _STLP_NATIVE_INCLUDE_PATH ../X86
# pragma message (STRINGIZE(../abcdefg))
# pragma message (STRINGIZE(../X86))
# pragma message (STRINGIZE(_STLP_NATIVE_INCLUDE_PATH))
# endif
输出为:
../abcdefg
../1
../1
I am trying to compile Boost 1.47 for x86 Windows CE using Visual Studio 2008 and STLPort 5.2.1. I can successfully compile for x86 Windows and ARMV4I Windows Mobile 6.5.
When I run bjam, I get this error in most every module:
stlport\ctype.h(42) : fatal error C1083: Cannot open include file: '../1/ctype.h': No such file or directory
That line of code the error refers to in STLPort's ctype.h is:
#include _STLP_NATIVE_C_HEADER(ctype.h)
If I create a new Visual Studio project and add the lines:
#define STR1(x) #x
#define STRINGIZE(x) STR1(x)
#pragma message (STRINGIZE(_STLP_NATIVE_C_HEADER(ctype.h)))
I see: <../X86/ctype.h>
as I would expect.
Why is boost replacing "X86" with "1"? It does not have this issue when compiling for ARMV4I Windows Mobile or x86 Windows.
Edit
More information. Something is very deliberately doing a string replace on "X86".
In stlport\stl\config_evc.h I added the pragma message
s to this code:
# if !defined (_STLP_NATIVE_INCLUDE_PATH)
# if defined (_X86_)
# if defined (_STLP_WCE_TARGET_PROC_SUBTYPE_EMULATOR)
# define _STLP_NATIVE_INCLUDE_PATH ../Emulator
# else
# define _STLP_NATIVE_INCLUDE_PATH ../X86
# pragma message (STRINGIZE(../abcdefg))
# pragma message (STRINGIZE(../X86))
# pragma message (STRINGIZE(_STLP_NATIVE_INCLUDE_PATH))
# endif
The output is:
../abcdefg
../1
../1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您定义了
X86
宏(通过早期包含的标头之一,或从命令行)并设置为1
,因此它会扩展,就像宏倾向于扩展一样做。#undef X86
将摆脱它。You have
X86
macro defined (either by one of the earlier-included headers, or from a command line) and set to1
, so it gets expanded, like macros tend to do.#undef X86
will get rid of it.