首先说明,我在虚拟机上已经执行了sudo apt-get install build-essential
然后我VIM编辑那段最简单的代码:
#include <stdio.h>
int main()
{printf(¨hello!\n¨);
return 0;
}
编译提示为:
main.c: In function ‘main’:
main.c:3: error: stray ‘\302’ in program
main.c:3: error: stray ‘\250’ in program
main.c:3: error: ‘hello’ undeclared (first use in this function)
main.c:3: error: (Each undeclared identifier is reported only once
main.c:3: error: for each function it appears in.)
main.c:3: error: expected ‘)’ before ‘!’ token
main.c:3: error: stray ‘\’ in program
main.c:3: error: stray ‘\302’ in program
main.c:3: error: stray ‘\250’ in program
然后复制了论坛里的代码如下:
#include<stdio.h>
int main()
{
printf("Hello Ubuntu!\n");
return 0;
}
可以正确编译。
肯定是输入字符的问题。双引号不一样。我想问的是:这是VIM什么输入?然后改怎么改才能正确编译?
一个很怪异的VIM问题,关于编译的。
- Batman1983
- 帖子: 13
- 注册时间: 2007-07-28 0:28
-
- 帖子: 52
- 注册时间: 2007-06-27 11:47
- Batman1983
- 帖子: 13
- 注册时间: 2007-07-28 0:28
- Batman1983
- 帖子: 13
- 注册时间: 2007-07-28 0:28
- Batman1983
- 帖子: 13
- 注册时间: 2007-07-28 0:28