steveicarus / iverilog

Icarus Verilog
https://steveicarus.github.io/iverilog/
GNU General Public License v2.0
2.82k stars 523 forks source link

undefined reference to `lexor_keyword_mask' #126

Closed jiapei100 closed 7 years ago

jiapei100 commented 8 years ago

Current GIT brought me the following error messages:

main.o: In function main': /home/jiapei/Downloads/hardware/iverilog/main.cc:939: undefined reference tolexor_keyword_mask' /home/jiapei/Downloads/hardware/iverilog/main.cc:954: undefined reference to lexor_keyword_mask' /home/jiapei/Downloads/hardware/iverilog/main.cc:958: undefined reference tolexor_keyword_mask' /home/jiapei/Downloads/hardware/iverilog/main.cc:961: undefined reference to lexor_keyword_mask' lexor.o: In functionVLlex()': /home/jiapei/Downloads/hardware/iverilog/lexor.lex:684: undefined reference to lexor_keyword_mask' lexor.o:/usr/include/c++/5/ext/new_allocator.h:104: more undefined references tolexor_keyword_mask' follow lexor.o: In function VLlex()': /home/jiapei/Downloads/hardware/iverilog/lexor.lex:280: undefined reference tolexor_keywordcode(char const, unsigned int)' /home/jiapei/Downloads/hardware/iverilog/lexor.lex:633: undefined reference to lexor_keyword_mask' /home/jiapei/Downloads/hardware/iverilog/lexor.lex:636: undefined reference tolexor_keyword_mask' /home/jiapei/Downloads/hardware/iverilog/lexor.lex:641: undefined reference to lexor_keyword_mask' /home/jiapei/Downloads/hardware/iverilog/lexor.lex:647: undefined reference tolexor_keyword_mask' /home/jiapei/Downloads/hardware/iverilog/lexor.lex:654: undefined reference to lexor_keyword_mask' lexor.o:/home/jiapei/Downloads/hardware/iverilog/lexor.lex:662: more undefined references tolexor_keywordmask' follow collect2: error: ld returned 1 exit status Makefile:222: recipe for target 'ivl' failed make: ** [ivl] Error 1

Cheers Pei

martinwhitaker commented 8 years ago

I can't reproduce this with a clean checkout and build:

git clone https://github.com/steveicarus/iverilog.git
cd iverilog
sh autoconf.sh
./configure
make

What O/S are you using, and what compiler? What version of gperf? When you ran make, did the call to gperf that generates the lexor_keyword.cc file run without any errors. If so, what is the output from

nm lexor_keyword.o
steveicarus commented 8 years ago

I tried to replicate it as well, and no luck. I think that Martin is right, something broke with your lexor_keyword.cc file. The "sh autoconf.sh" step makes that file using gperf. You sure you have gperf installed?

On Tue, Sep 13, 2016 at 2:41 PM, martinwhitaker notifications@github.com wrote:

I can't reproduce this with a clean checkout and build:

git clone https://github.com/steveicarus/iverilog.git cd iverilog sh autoconf.sh ./configure make

What O/S are you using, and what compiler? What version of gperf? When you ran make, did the call to gperf that generates the lexor_keyword.cc file run without any errors. If so, what is the output from

nm lexor_keyword.o

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/steveicarus/iverilog/issues/126#issuecomment-246834163, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAlMnvfLO-Q8oVoIn7d1g9aKcugMNmJks5qpxiCgaJpZM4J7Zsb .

Steve Williams "The woods are lovely, dark and deep. steve@icarus.com steveicarus@gmail.com But I have promises to keep, http://www.icarus.com and lines to code before I sleep, http://www.picturel.com And lines to code before I sleep."

martinwhitaker commented 7 years ago

As there's been no response for over 2 months, I'm going to assume it was a local problem and is now fixed. Please feel free to reopen if there is still an issue.

brooksbp commented 7 years ago

I just hit this issue. Installing gperf resolved it.

cr1901 commented 4 years ago

@martinwhitaker Just FYI, you can get into this state by running autoconf.sh- accidentally or otherwise- in your build directory rather than the source directory:

william@xubuntu-dtrain:~/Projects/FPGA/build-ivl$ sh ../iverilog/autoconf.sh --prefix=/home/william/.local
Autoconf in root...
autoconf: error: no input file
Precompiling lexor_keyword.gperf
Cannot open input file './lexor_keyword.gperf'
Precompiling vhdlpp/lexor_keyword.gperf
../iverilog/autoconf.sh: 16: cd: can't cd to vhdlpp
Cannot open input file './lexor_keyword.gperf'
william@xubuntu-dtrain:~/Projects/FPGA/build-ivl$ ls
lexor_keyword.cc
william@xubuntu-dtrain:~/Projects/FPGA/build-ivl$ ll
total 8
drwxrwxr-x  2 william william 4096 Aug 22 20:32 ./
drwxrwxr-x 35 william william 4096 Aug 22 20:32 ../
-rw-rw-r--  1 william william    0 Aug 22 20:32 lexor_keyword.cc
william@xubuntu-dtrain:~/Projects/FPGA/build-ivl$

Can't promise that is what the person who opened the issue ran into, but I thought it was worth mentioning. Is there a way to get gperf to not emit an empty file if the input file doesn't exist (or delete it as part of cleanup)?