I ran into this problem when porting TXR to Windows using MinGW.
MinGW has a flexible library for itself, but does not export it to the environment.
See here: http://lists.nongnu.org/archive/html/txr-users/2011-10/msg00001.html
A workaround is to use -L/usr/lib to -lfl . But think about it: it's a hack. What for? Since the path /usr/lib/ belongs to MinGW, the compilation runtime is.
/usr/lib not where it is supposed that the tool chain should look for libraries for the Windows program being created (which is not in the library search path!)
That is, we effectively steal our own library of build machines in a cross-compilation job.
It looks like you cross-compile, say, Fedora on Ubuntu, and help the Ubuntu static library in /usr/lib , which is not in the Fedora cross-program set (taking advantage of the fact that the architecture and format of the object file are the same).
This is definitely a mistake in how Flex is “packaged” in MingW.
Kaz
source share