You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The definition is in the generated header and implementation file, admittedly the problem goes away if FlexLexer.h is used instead of the generated header (which I hadn't realized before), but in the more complex project I have this is not an option.
#include"ScannerX.hpp"intmain() {
FlexLexer *lex = new yyFlexLexer;
lex->yylex();
}
>win_flex --wincompat lexer_bug.l
>cl /EHsc /I. /Fetest.exe main.cpp ScannerX.cpp
[...]
Generating Code...
Microsoft (R) Incremental Linker Version 14.28.29334.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.exe
main.obj
ScannerX.obj
ScannerX.obj : error LNK2005: "public: virtual int __thiscall yyFlexLexer::yywrap(void)" (?yywrap@yyFlexLexer@@UAEHXZ) already defined in main.obj
test.exe : fatal error LNK1169: one or more multiply defined symbols found
Both ScannerX.hpp and ScannerX.cpp contain: int yyFlexLexer::yywrap() { return 1; }
So to clarify, it's all of %option c++ noyywrap and header= which appear to be incompatible when using #include with the generated header. The offending line in winflexbison is flex\src\main.c:1774
related to westes/flex#472
The text was updated successfully, but these errors were encountered: