Multiple inclusions cause multiple definitions => compile error

mitchell mforal.n... at
Fri May 23 22:29:01 UTC 2008


This is a result of my previous thread on multiple inclusion errors.

Here's what I'm working with:
  css.rl - a CSS parser
  javascript.rl - a Javascript parser
  html.rl - a HTML parser that 'include's css.rl and javascript.rl.

css.rl 'include's a common.rl while javascript.rl and html.rl do not
(as you asked in my previous thread)

I get no compilation errors from ragel, but when I compile the
generated C code, specifically html.c, I get 'previous definition was
here' errors from gcc. I went into the code and one of the 2 dozen or
so redeclarations was:
  static const char _html_actions[] = {
It was declared 3 times throughout html.c. I removed the javascript.rl
'include' statement and tried to compile again. This time the same
_html_actions was declared 2 times. It seems 'include' has some
strange effects.

Any idea what's going wrong? Do you need more information?


More information about the ragel-users mailing list