5

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?

saffsd
  • 483
  • 5
  • 8
  • can you post the steps you're taking to do this build? That sure looks like a command line switch mistakenly taken as a command. – Avery Payne Jul 29 '09 at 04:34

3 Answers3

5

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.

Jonathan Leffler
  • 1,035
  • 11
  • 20
3

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
Alexander Tolkachev
  • 4,513
  • 3
  • 14
  • 23
sam
  • 31
  • 1
  • thanks. your answer led me to what I think is the ubuntu equivalent: https://stackoverflow.com/a/70525465/5203563 – Alex028502 Dec 29 '21 at 22:03
1

What if you run $(which ld) (using command substitution, or you can use backticks in place of $(…)) instead of just ld?

If that helps, then type in alias -p and see if you have an alias set for the ld command which is causing the -ll switch to be sent.

Jonathan Leffler
  • 1,035
  • 11
  • 20
resonator
  • 281
  • 1
  • 10