我正在尝试在OS X 10.8.2上安装QMCPACK,我遇到了很多这样的错误:
bspline_base.h:95:17: error: expected ';' at end of declaration list
void *restrict coefs;
^
;
我不熟悉restrict关键字,但我觉得这可能是其他类型的问题,因为这是一个为其他人编译的流行代码。
以下是该代码的完整上下文:
typedef struct
{
spline_code sp_code;
type_code t_code;
void *restrict coefs;
} Bspline;
答案 0 :(得分:2)
restrict
不是标准 C ++ 中的关键字。代码只能在支持restrict
扩展名的编译器中编译。
restrict
C99 中的关键字。因此,如果您使用 C99 编译器,它将正常工作。
答案 1 :(得分:0)
restrict
仅在C模式下可用。 clang++
需要__restrict
- 将-Drestrict=__restrict
添加到编译器标记。