Skip to content

Instantly share code, notes, and snippets.

@nobodxbodon
Last active November 26, 2017 06:25
Show Gist options
  • Save nobodxbodon/a44113fa40a9d453c9eeed3a2edd8964 to your computer and use it in GitHub Desktop.
Save nobodxbodon/a44113fa40a9d453c9eeed3a2edd8964 to your computer and use it in GitHub Desktop.
test gcc with chinese keywords
without change:
$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
$ gcc 你好.c
你好.c:10:1: error: stray ‘\351’ in program
void 问好();
^
你好.c:10:1: error: stray ‘\227’ in program
你好.c:10:1: error: stray ‘\256’ in program
你好.c:10:1: error: stray ‘\345’ in program
你好.c:10:1: error: stray ‘\245’ in program
你好.c:10:1: error: stray ‘\275’ in program
你好.c:10:13: error: expected identifier or ‘(’ before ‘)’ token
void 问好();
^
你好.c: In function ‘main’:
你好.c:13:3: error: stray ‘\351’ in program
问好();
^
你好.c:13:3: error: stray ‘\227’ in program
你好.c:13:3: error: stray ‘\256’ in program
你好.c:13:3: error: stray ‘\345’ in program
你好.c:13:3: error: stray ‘\245’ in program
你好.c:13:3: error: stray ‘\275’ in program
你好.c:13:10: error: expected expression before ‘)’ token
问好();
^
你好.c: At top level:
你好.c:16:1: error: stray ‘\351’ in program
void 问好() {
^
你好.c:16:1: error: stray ‘\227’ in program
你好.c:16:1: error: stray ‘\256’ in program
你好.c:16:1: error: stray ‘\345’ in program
你好.c:16:1: error: stray ‘\245’ in program
你好.c:16:1: error: stray ‘\275’ in program
你好.c:16:13: error: expected identifier or ‘(’ before ‘)’ token
void 问好() {
^
3:04 start git clone
3:19 finish
./configure:
error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
https://stackoverflow.com/questions/9253695/building-gcc-requires-gmp-4-2-mpfr-2-3-1-and-mpc-0-8-0
$ sudo apt-get install libmpc-dev
collect2: error: ld returned 1 exit status
configure: error: I suspect your system does not have 32-bit development libraries (libc and headers). If you have them, rerun configure with --enable-multilib. If you do not have them, and want to build a 64-bit-only compiler, rerun configure with --disable-multilib.
https://stackoverflow.com/questions/24325754/gcc-installation-error
sudo apt-get install gcc-multilib
succeed in ./configure
3:26 start: $ make bootstrap ==>
takes forever!!!
https://gcc.gnu.org/ml/gcc-help/2007-02/msg00347.html
$ sudo apt-get install flex
$ make install ===> 失败后又install gcc
仍然错误:
gcc: error trying to exec 'cc1': execvp: No such file or directory
https://stackoverflow.com/questions/11912878/gcc-error-gcc-error-trying-to-exec-cc1-execvp-no-such-file-or-directory
./configure --disable-multilib --enable-languages=c,c++ --prefix=/usr/local/gnu_tools/ && make clean && make bootstrap && sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment