我正在尝试使用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用“1”代替“X86”?为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

最佳答案

您已经定义了X86宏(通过较早包含的头文件之一或从命令行),并将其设置为1,因此它像宏一样容易扩展。 #undef X86将摆脱它。

关于c++ - 错误编译 boost ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7812009/

10-09 16:40
查看更多