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?

  • 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. Jul 29, 2009 at 4:34

3 Answers 3


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.


while compiling lex yacc programs... if you get this 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

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.

  • I'm not calling ld directly, that's make at work. I've updated the question to make this clearer.
    – saffsd
    Jul 29, 2009 at 4:43
  • take a look at line 189 of "src/libs-cmd/Makefile". Maybe you can modify the command there to make it work.
    – resonator
    Jul 29, 2009 at 4:59
  • I've gone and removed the -ll, and that seems to work.
    – saffsd
    Jul 29, 2009 at 5:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.