Some context:
My program uses libary libfl.a (flex library). I compile it under linux:
gcc lex.yy.c -lfl
I have mingw compiler installed
i586-mingw32msvc-gcc
(simple 'hello world' stuff compiles without problem)I use ubuntu (probably does not matter)
I want to compile under linux for windows (produce binary .exe file which would be usable on windows)
My problem and questions:
When I try compiling my program
i586-mingw32msvc-gcc lex.yy.c -lfl
I get errors:
[...] undefined reference to '_yywrap'
[...] undefined reference to '_WinMain@16'
- Do I understand correctly that I have to compile the content of
libfl.a
also with i586-mingw32msvc-gcc to be able to use it in this cross-compilation? - In the source code there is function
yywrap()
, but not_yywrap()
. Why I get error for function with underscore_
? - Whats up with the
_WinMain@16
? (no usage in source code)
My goal would be to understand what is happening here. If I get it to work, then its bonus points :)
Any help is appreciated