C++ C++;错误:';内联';只能出现在函数上

C++ C++;错误:';内联';只能出现在函数上,c++,clang,libc++,C++,Clang,Libc++,我正在尝试使用clang++在OSX10.7下编译 我用CXX=clang++配置项目,因为苹果的gcc似乎无法识别所需的-std=c++0x标志 我将-stdlib=libc++添加到cxflags中,因为如果没有这个叮当声,我甚至无法找到\include 目前我有:cxflags=-std=c++0x-stdlib=libc++-Wall-Wextra-Wcast align-Wpointer arith-Wno开关-Wno符号比较-Wno未使用的参数-Wc++11扩展名 问题是我遇到了以下

我正在尝试使用clang++在OSX10.7下编译

我用
CXX=clang++
配置项目,因为苹果的gcc似乎无法识别所需的
-std=c++0x
标志

我将
-stdlib=libc++
添加到
cxflags
中,因为如果没有这个叮当声,我甚至无法找到
\include

目前我有:
cxflags=-std=c++0x-stdlib=libc++-Wall-Wextra-Wcast align-Wpointer arith-Wno开关-Wno符号比较-Wno未使用的参数-Wc++11扩展名

问题是我遇到了以下错误:

clang: warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior    is deprecated
clang: warning: argument unused during compilation: '-ggdb'
StdInc.h:1:9: warning: #pragma once in main file
#pragma once
        ^
In file included from StdInc.h:3:
In file included from ./../Global.h:32:
In file included from /usr/bin/../lib/c++/v1/algorithm:594:
In file included from /usr/bin/../lib/c++/v1/memory:596:
/usr/bin/../lib/c++/v1/iterator:1696:1: error: 'inline' can only appear on functions
inline _LIBCPP_INLINE_VISIBILITY
^
/usr/bin/../lib/c++/v1/iterator:1698:1: error: variable 'begin' declared as a template
begin(_T (&__array)[_N])
^
/usr/bin/../lib/c++/v1/iterator:1698:12: error: use of undeclared identifier '__array'
begin(_T (&__array)[_N])
           ^
./../tchar_amigaos4.h:157:16: note: expanded from macro '_T'
#define _T(x)           x
                        ^
In file included from StdInc.h:3:
In file included from ./../Global.h:32:
In file included from /usr/bin/../lib/c++/v1/algorithm:594:
In file included from /usr/bin/../lib/c++/v1/memory:596:
/usr/bin/../lib/c++/v1/iterator:1698:25: error: expected ';' at end of declaration
begin(_T (&__array)[_N])
                        ^
                        ;
/usr/bin/../lib/c++/v1/iterator:1699:1: error: expected unqualified-id
{
^
1 warning and 5 errors generated.
我必须承认我从未见过这样的事。这些都是libc++源代码! 有人知道原因吗?

您的问题是:

./../tchar_amigaos4.h:157:16: note: expanded from macro '_T'
#define _T(x)           x
严格来说,在代码中定义一个名为_T的宏,然后包括标准头,是未定义的行为


IIRC,更新版本的libc++避免使用这个名称,特别是因为人们往往会把它搞砸,所以您可能想尝试升级到最新版本的命令行工具。

您是否验证了您的源代码包含在std lib头之后?