/usr/bin/ld: cannot find -ll
I am trying to build a LIBS from the Thai Computational Linguistics Laboratory from source.
I am following the instructions as per their readme, which states
2. Installation --------------- 2.1) In the libs base directory, type: $ ./configure $ make
However, ld complains about 'cannot find -ll'.
if gcc -DHAVE_CONFIG_H -I. -I. -I../.. -W -Wall -I../../src/libs -g -O2 -MT libs-predict.o -MD -MP -MF ".deps/libs-predict.Tpo" -c -o libs-predict.o libs-predict.c; \ then mv -f ".deps/libs-predict.Tpo" ".deps/libs-predict.Po"; else rm -f ".deps/libs-predict.Tpo"; exit 1; fi mode=link g++ -g -O2 -o libs-predict libs-predict.o -L../../src/libs -llibs -lm -ll /usr/bin/ld: cannot find -ll collect2: ld returned 1 exit status make[3]: [libs-predict] Error 1 (ignored)
What library is this and what package do I need to install to have it?
Solution 1:
The library libl.a is classically the support library for AT&T Lex - it provides a dummy version of yywrap()
and main()
, and some other support functions. If you are using Flex, then I don't think any library is needed - the code is self-contained (as long as you provide your own version of yywrap
; if you don't, use -lfl
). So, you probably just need to arrange to remove the '-ll
' from the command line.
If that is too hard, then create yourself a file garbage.c
containing:
int podunk = 0;
Compile it to garbage.o
and create a dummy libl.a
:
gcc -c garbage.c
ar r libl.a garbage.o
The linker should pick up this dummy library, find nothing of relevance in it, and continue its merry way onwards.
Solution 2:
while compiling lex yacc programs... if you get this error...
Error:
/usr/bin/ld: cannot find -ll
collect2: error: ld returned 1 exit status
Then Solution for this is :
dnf install flex bison
dnf install flex-devel bison-devel