Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  IPC::Locker
  Parallel::Forker
  Voneline
General Info
  Papers

Issue #1329

Compile error "expected unqualified-id before numeric constant"

Added by Shawn Boshart over 1 year ago. Updated about 1 year ago.

Status:
NoFixNeeded
Priority:
Normal
Assignee:
-
Category:
Configure/Make/Compiling
% Done:

0%


Description

./configure runs without issue, but make fails with the below message. I have tried newer versions of flex/bison, but cannot figure how to solve.

sccj017209:12:10pm:/<4>tools/verilator/verilator-3.853> make
------------------------------------------------------------
making verilator in src                                     
make[1]: Entering directory `/nfs/sc/disks/axx_0022/tools/verilator/verilator-3.853/src'
cd obj_dbg && make -j 1  TGT=../../verilator_bin_dbg VL_DEBUG=1 -f ../Makefile_obj serial
make[2]: Entering directory `/nfs/sc/disks/axx_0022/tools/verilator/verilator-3.853/src/obj_dbg'
make[2]: Nothing to be done for `serial'.                                                       
make[2]: Leaving directory `/nfs/sc/disks/axx_0022/tools/verilator/verilator-3.853/src/obj_dbg' 
cd obj_dbg && make       TGT=../../verilator_bin_dbg VL_DEBUG=1 -f ../Makefile_obj              
make[2]: Entering directory `/nfs/sc/disks/axx_0022/tools/verilator/verilator-3.853/src/obj_dbg'
      Compile flags:  g++ -I/nfs/sc/disks/axx_0022/tools/verilator/3.853/include -MMD -I. -I.. -I.. -I../../include -DYYDEBUG -ggdb -DVL_DEBUG -MP -DDEFENV_SYSTEMC="" -DDEFENV_SYSTEMC_ARCH="" -DDEFENV_SYSTEMC_INCLUDE="" -DDEFENV_SYSTEMC_LIBDIR="" -DDEFENV_SYSTEMPERL="" -DDEFENV_SYSTEMPERL_INCLUDE="" -DDEFENV_VERILATOR_ROOT="/nfs/sc/disks/axx_0022/tools/verilator/verilator-3.853" 
g++ -I/nfs/sc/disks/axx_0022/tools/verilator/3.853/include -MMD -I. -I.. -I.. -I../../include -DYYDEBUG          -ggdb -DVL_DEBUG -MP  -DDEFENV_SYSTEMC=\"\" -DDEFENV_SYSTEMC_ARCH=\"\" -DDEFENV_SYSTEMC_INCLUDE=\"\" -DDEFENV_SYSTEMC_LIBDIR=\"\" -DDEFENV_SYSTEMPERL=\"\" -DDEFENV_SYSTEMPERL_INCLUDE=\"\" -DDEFENV_VERILATOR_ROOT=\"/nfs/sc/disks/axx_0022/tools/verilator/verilator-3.853\" -Wno-unused -c ../V3ParseLex.cpp                                                                                                                                                             
In file included from V3Lexer_pregen.yy.cpp:245:0,                                                                                                                                             
                 from ../V3ParseLex.cpp:37:                                                                                                                                                    
/usr/include/FlexLexer.h:130:14: error: expected unqualified-id before numeric constant                                                                                                        
In file included from ../V3ParseLex.cpp:37:0:                                                                                                                                                  
V3Lexer_pregen.yy.cpp: In member function ‘virtual int V3LexerBase::yylex()’:                                                                                                                  
V3Lexer_pregen.yy.cpp:3456:10: error: ‘yy_current_buffer’ was not declared in this scope                                                                                                       
In file included from ../V3ParseLex.cpp:37:0:                                                                                                                                                  
V3Lexer_pregen.yy.cpp:7276:8: error: ‘yy_current_buffer’ was not declared in this scope                                                                                                        
V3Lexer_pregen.yy.cpp:7299:23: error: ‘yy_current_buffer’ was not declared in this scope                                                                                                       
V3Lexer_pregen.yy.cpp: In constructor ‘V3LexerBase::V3LexerBase(std::istream*, std::ostream*)’:                                                                                                
V3Lexer_pregen.yy.cpp:7416:2: error: ‘yy_current_buffer’ was not declared in this scope                                                                                                        
V3Lexer_pregen.yy.cpp: In destructor ‘virtual V3LexerBase::~V3LexerBase()’:                                                                                                                    
V3Lexer_pregen.yy.cpp:7428:20: error: ‘yy_current_buffer’ was not declared in this scope                                                                                                       
V3Lexer_pregen.yy.cpp: In member function ‘virtual void V3LexerBase::switch_streams(std::istream*, std::ostream*)’:
V3Lexer_pregen.yy.cpp:7435:21: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘int V3LexerBase::yy_get_next_buffer()’:
V3Lexer_pregen.yy.cpp:7488:24: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘void V3LexerBase::yyunput(int, char*)’:
V3Lexer_pregen.yy.cpp:7683:15: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘int V3LexerBase::yyinput()’:
V3Lexer_pregen.yy.cpp:7725:22: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘virtual void V3LexerBase::yyrestart(std::istream*)’:
V3Lexer_pregen.yy.cpp:7784:9: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp:7787:18: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘virtual void V3LexerBase::yy_switch_to_buffer(YY_BUFFER_STATE)’:
V3Lexer_pregen.yy.cpp:7794:7: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp:7797:7: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp:7805:2: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘void V3LexerBase::yy_load_buffer_state()’:
V3Lexer_pregen.yy.cpp:7819:15: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘virtual void V3LexerBase::yy_delete_buffer(YY_BUFFER_STATE)’:
V3Lexer_pregen.yy.cpp:7856:12: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘void V3LexerBase::yy_flush_buffer(YY_BUFFER_STATE)’:
V3Lexer_pregen.yy.cpp:7898:12: error: ‘yy_current_buffer’ was not declared in this scope
make[2]: *** [V3ParseLex.o] Error 1
make[2]: Leaving directory `/nfs/sc/disks/axx_0022/tools/verilator/verilator-3.853/src/obj_dbg'
make[1]: *** [../verilator_bin_dbg] Error 2
make[1]: Leaving directory `/nfs/sc/disks/axx_0022/tools/verilator/verilator-3.853/src'
make: *** [verilator_exe] Error 2

History

#1 Updated by Wilson Snyder over 1 year ago

  • Status changed from New to AskedReporter

Sorry you are having problems.

What OS version?

What flex version?

What is the code around the lines the compiler is complaining about?

#2 Updated by Shawn Boshart over 1 year ago

OS: sccj017209:10:04am:sdg74_MDWA0P10_SETUP~/axx_0022/sboshart/MDWA0> uname -a Linux sccj017209 3.0.101-108.13.1.14249.0.PTF-default #1 SMP Thu Nov 30 18:45:29 UTC 2017 (ae6bb13) x86_64 x86_64 x86_64 GNU/Linux

FLEX: sccj017209:10:10am:/<4>tools/verilator/verilator-3.853> flex -V flex 2.6.4

What is the code around the lines the compiler is complaining about? In file included from V3Lexer_pregen.yy.cpp:245:0, from ../V3ParseLex.cpp:37: /usr/include/FlexLexer.h:130:14: error: expected unqualified-id before numeric constant In file included from ../V3ParseLex.cpp:37:0:

I think this is the line it is complaining about: virtual int yywrap();

#3 Updated by Wilson Snyder over 1 year ago

What distribution, e.g. Ubuntu 18.04, etc. (uname is the kernel version which doesn't say the distro.)

#4 Updated by Shawn Boshart over 1 year ago

Does this help?

sccj017209:4:22pm:/tmp/sboshart> rpm -qi glibc
Name        : glibc                        Relocations: (not relocatable)
Version     : 2.11.3                            Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
Release     : 17.109.1                      Build Date: Tue 06 Jun 2017 02:13:05 PM PDT
Install Date: Wed 11 Apr 2018 12:13:30 PM PDT      Build Host: sheep25
Group       : System/Libraries              Source RPM: glibc-2.11.3-17.109.1.src.rpm
Size        : 5554557                          License: BSD 3-Clause; GPL v2 or later; LGPL v2.1 or later
Signature   : RSA/8, Tue 06 Jun 2017 02:15:42 PM PDT, Key ID e3a5c360307e3d54
Packager    : https://www.suse.com/
URL         : http://www.gnu.org/software/libc/libc.html
Summary     : Standard Shared Libraries (from the GNU C Library)
Description :
The GNU C Library provides the most important standard libraries used
by nearly all programs: the standard C library, the standard math
library, and the POSIX thread library. A system is not functional
without these libraries.
Distribution: SUSE Linux Enterprise 11

#5 Updated by Wilson Snyder over 1 year ago

  • Description updated (diff)

You must in a big company to use an almost 10 year old distribution ;) Do they know that SuSE 11 general supports ends in a few months?

Anyhow I don't have a license so you'll need to debug yourself, if you're not sure how to do this ask someone in your organization that knows C++. Look at the sources around line 140 of /usr/include/FlexLexer.h:13, and also at V3Lexer_pregen.yy.cpp around line 3456.

#6 Updated by S Bagchi over 1 year ago

This make error is also seen with the following version of Linux: Red Hat Enterprise Linux Server release 6.9 (Santiago)

#7 Updated by Wilson Snyder over 1 year ago

  • Subject changed from Cannot install Verilator due to error during make to Compile error "expected unqualified-id before numeric constant"
  • Category set to Configure/Make/Compiling

Note on a hunch I tried using SEL 6.9 which is generally the same as RHEL 6.9, and it worked without issues, so you're still stuck to debug this locally, sorry.

#8 Updated by Wilson Snyder about 1 year ago

Did you have any luck debugging this, or working around it?

#9 Updated by Shawn Boshart about 1 year ago

Please close. I copied a Linux redhat build over to Suse and it worked.

#10 Updated by Wilson Snyder about 1 year ago

  • Status changed from AskedReporter to NoFixNeeded

Also available in: Atom