【发布时间】:2014-08-14 18:07:33
【问题描述】:
我在lexer.mll中使用#include ".../frontend/tokens.mll",然后cpp -C -P frontend/lexer.mll -o frontend/lexer_new.mll生成lexer_new.mll。
这一直有效,直到我昨天将我的 ubuntu 从 12.04 升级到 14.04。
编译报错:
ocamllex frontend/lexer_new.mll
File "frontend/lexer_new.mll", line 1, character 1: illegal character /.
make: *** [frontend/lexer_new.ml] Error 3
那是因为lexer_new.mll开头已经插入了几行C cmets:
/* Copyright (C) 1991-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
... */
我不记得升级前是否生成了相同的 cmets。
有谁知道如何搭这些 cmets?
PS:gcc 版本为:gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
【问题讨论】:
标签: gcc ocaml c-preprocessor