【问题标题】:Expected Declaration Specifiers Error?预期的声明说明符错误?
【发布时间】:2013-06-03 18:01:27
【问题描述】:

我在 AOP 中工作,在 Ubuntu 虚拟机中使用 AspeCt。我的.acc 代码:

before (): execution(int main(void)) {
    printf("Before test successful!\n");
}
after (): execution(int main(void)) {
    printf("world!\n");
}
before():
call(foo) {

printf("Before Foo!\n");

}

我的.mc 代码:

void foo(void) {

printf("foo\n");

}

int main() {

printf("Hello everyone ");
foo();
return 0;

}

以及错误信息:

1:13: error: expected declaration specifiers before ':' token
4:1: error : expected declaration specifiers before 'after'
7:1: error: expected declaration specifiers before 'before'
12:1 expected '{' at end of input

请帮忙?我很困惑如何解决这个问题!谢谢

【问题讨论】:

    标签: c compiler-errors aop declaration aspect


    【解决方案1】:

    修复了这个问题,你需要在 Linux 环境中使用 gcc 对文件进行预处理,分别保存为 .acc 和 .mc 文件。然后,您需要一起通过 acc 运行它们,并再次通过 gcc 运行生成的 .c 文件。 ./a.out 就完成了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-06-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-19
      • 2021-12-29
      • 2013-11-19
      相关资源
      最近更新 更多