Skip to content
Discussion options

You must be logged in to vote

Here's how to fix it:

First issue: The filename of your Flex file is Exo.1.1.lex but your makefile references Exo.1.1.flex. Make sure these match.
Main issue: Replace -lfl with -ll in the makefile. On macOS, the Flex library is named libl rather than libfl.

Here's the corrected makefile line:
$(NOM).exe : lex.yy.c
cc lex.yy.c -ll -o $(NOM).exe

If that still doesn't work, you can try using the full path to the library:

$(NOM).exe : lex.yy.c
cc lex.yy.c -L/opt/homebrew/opt/flex/lib -ll -o $(NOM).exe

Another alternative is to add the homebrew lib directory to the dynamic library path in your .zshrc:

export DYLD_LIBRARY_PATH="/opt/homebrew/opt/flex/lib:$DYLD_LIBRARY_PATH"
After making these c…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@adele25p
Comment options

Answer selected by adele25p
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Ask and answer questions about GitHub features and usage Programming Help Discussions around programming languages, open source and software development
2 participants