"Error: expected a declaration" in apache hadoop source code with Visual Studio 2010

"Error: expected a declaration" in apache hadoop source code with Visual Studio 2010

我正在单个集群上安装 Apache Hadoop,实际上是在我的笔记本电脑上。我已经全部按照说明书安装了 here, however, I have got errors while installing. A solution 就是用VS手动编译,我已经做到了。但是在构建代码时,我收到以下行的错误

#define WIDEN_STRING(x) WIDEN_STRING_(x)
#define WIDEN_STRING_(x) L ## x
#define STRINGIFY(x) STRINGIFY_(x)
#define STRINGIFY_(x) #x

#pragma message("WSCE config is " STRINGIFY(WSCE_CONFIG_DIR) "\" STRINGIFY(WSCE_CONFIG_FILE))

const WCHAR* wsceConfigRelativePath = WIDEN_STRING(STRINGIFY(WSCE_CONFIG_DIR)) L"\" WIDEN_STRING(STRINGIFY(WSCE_CONFIG_FILE));

在文件 HADOOP_SRC_FOLDER\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.c.

但是,我的问题是这行代码有什么问题?虽然按照C++的标准看来是无效的。我对这行代码完全感到困惑。

在 Hadoop 2.6 中,这是通过 maven 处理的。这些值在 hadoop-common-project/hadoop-common/pom.xml 文件中定义为属性,如下所示:

<properties>
<hadoop.component>common</hadoop.component>
<is.hadoop.component>true</is.hadoop.component>
<wsce.config.dir>../etc/hadoop</wsce.config.dir>
<wsce.config.file>wsce-site.xml</wsce.config.file>
</properties>

这稍后在调用 msbuild 时使用 <argument>/p:WsceConfigDir=${wsce.config.dir}</argument> <argument>/p:WsceConfigFile=${wsce.config.file}</argument>

中的libwinutils.vxcproj,则定义WSCE_CONFIG_DIR和WSCE_CONFIG_FILE如下:

 <PreprocessorDefinitions>WIN32;_DEBUG;_UNICODE;UNICODE;WSCE_CONFIG_DIR=$(WsceConfigDir);WSCE_CONFIG_FILE=$(WsceConfigFile);%(PreprocessorDefinitions)</PreprocessorDefinitions>