编译boost时出错

error compiling boost

本文关键字:出错 boost 编译      更新时间:2023-10-16

我正在尝试使用Visual Studio 2008和STLPort 5.2.1为x86 Windows CE编译Boost 1.47。我可以成功地编译x86 Windows和ARMV4I Windows Mobile 6.5。

当我运行bjam时,我在大多数每个模块中都会遇到这个错误:

stlportctype.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\sll\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会去掉它。