when compiling error "cc1plus: fatal error: gengtype-lex.cc: No such file or dir"
Jonathan Wakely
jwakely.gcc@gmail.com
Sun Mar 9 08:50:42 GMT 2025
On Sun, 9 Mar 2025 at 07:47, Gwen Fu via Gcc-help <gcc-help@gcc.gnu.org> wrote:
>
> OS: Ubuntu 22.04 X86_64
> gcc version :11.04
>
> After having compiled for almost 10 minutes , the error occurred
> here is the description:
> /bin/bash ../../gcc/gcc/../move-if-change tmp-version.h version.h
> echo timestamp > s-version
> g++ -std=c++14 -c -g -DIN_GCC -fno-exceptions -fno-rtti
> -fasynchronous-unwind-tables -W -Wall -Wno-error=narrowing -Wwrite-strings
> -Wcast-qual -Wno-format -Wmissing-format-attribute
> -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long
> -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H
> -DGENERATOR_FILE -I. -Ibuild -I../../gcc/gcc -I../../gcc/gcc/build
> -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include \
> -o build/gengtype.o ../../gcc/gcc/gengtype.cc
> /home/gwen/github_repo/gcc/missing flex -ogengtype-lex.cc
> ../../gcc/gcc/gengtype-lex.l && { \
> echo '#ifdef HOST_GENERATOR_FILE' > gengtype-lex.cc.tmp; \
> echo '#include "config.h"' >> gengtype-lex.cc.tmp; \
> echo '#else' >> gengtype-lex.cc.tmp; \
> echo '#include "bconfig.h"' >> gengtype-lex.cc.tmp; \
> echo '#endif' >> gengtype-lex.cc.tmp; \
> cat gengtype-lex.cc >> gengtype-lex.cc.tmp; \
> mv gengtype-lex.cc.tmp gengtype-lex.cc; \
> }
> /home/gwen/github_repo/gcc/missing: 81: flex: not found
> WARNING: 'flex' is missing on your system.
> You should only need it if you modified a '.l' file.
> You may want to install the Fast Lexical Analyzer package:
> <http://flex.sourceforge.net/>
> make[3]: [Makefile:3408:gengtype-lex.cc] 错误 127 (已忽略)
> g++ -std=c++14 -c -g -DIN_GCC -fno-exceptions -fno-rtti
> -fasynchronous-unwind-tables -W -Wall -Wno-error=narrowing -Wwrite-strings
> -Wcast-qual -Wno-format -Wmissing-format-attribute
> -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long
> -Wno-variadic-macros -Wno-overlength-strings -Wno-error -DHAVE_CONFIG_H
> -DGENERATOR_FILE -I. -Ibuild -I../../gcc/gcc -I../../gcc/gcc/build
> -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include \
> -o build/gengtype-lex.o gengtype-lex.cc
> cc1plus: fatal error: gengtype-lex.cc: 没有那个文件或目录
> compilation terminated.
> make[3]: *** [Makefile:3185:build/gengtype-lex.o] 错误 1
> make[3]: leave dir“/home/gwen/github_repo/objdir/gcc”
> make[2]: *** [Makefile:5055:all-stage1-gcc] 错误 2
> make[2]: leave dir“/home/gwen/github_repo/objdir”
> make[1]: *** [Makefile:26356:stage1-bubble] 错误 2
> make[1]: leave dir“/home/gwen/github_repo/objdir”
> make: *** [Makefile:1100:all] 错误 2
Run:
sudo apt-get install -y build-essential flex bison
Then remove the build directory and start again from the configure step.
More information about the Gcc-help
mailing list