Alright. So it turns out I was missing a parameter named %option noyywrap
, which goes here:
%{
int a = 0, b = 0;
%}
%option noyywrap
%%
\n ++a; ++b;
. ++b;
...
Apparently this tells FLEX that there's only one source file. So it's not a gcc
issue, it was a FLEX config problem.
Thank you all for taking the time to read the question. Hope this helps anyone else.