按照这个解决方案,我用#include "...frontend/tokens.mll"
在我的lexer.mll
,然后我用它cpp -P frontend/lexer.mll -o frontend/gen/lexer.mll
来生成完整的 mll 文件。该解决方案以前在 Ubuntu 下有效。
现在,我尝试在 中执行此操作Mac OS 10.11.1
,它给出了一个错误clang: error: no input files
。
gcc -v
返回
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
我看不到我在哪里使用 XCode 或 PCH 文件。有谁知道我应该如何配置环境才能cpp
工作?
编辑1:
cpp --version
返回
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
还有评论中的一个例子: