This is not really a C++ question. You may have better luck
in a group that discusses your tool chain. (You're probably
using the GNU tool chain.)
Or one for the library in question---the "installation"
instructions should cover the steps necessary to link it.
The archive's (.a file's) directory may not be in your library
path,
With g++, at least, he'd get an error from the linker saying
that the library could not be found.
or the library may be seen by the linker before the
object (.o file) that needs somefunction. Order counts; don't
list the library until after the objects that use it.
Order counts with some linkers, not with others. (I've even
used one where order of the object files in the library
counted.)
For static archives, you don't really need -l, anyway.
Include the archive on the command-line, just as though it
were an object or source file:
g++ -o main some_source.cc some_object.o some_archive.a
"Undefined reference" is a linker error, not a compiler error.
(You could write a compiler that complained of undefined
references, but you'd have to be a special kind of mean to do
it. The terms "undefined" and "reference" both have technical
meaning in C++.)
Whereas "linker" doesn't
. The C++ standard doesn't speak of
a separate preprocessor, compiler or linker; just an
"implementation". (Practically speaking, of course: phases 1-6
are commonly called the "preprocessor", phase 7 is the compiler
and phase 9 the linker. Where phase 8 fits in is somewhat open,
in that it is only relevant when templates are involved, and the
commun terminology was established before templates. Most
current implementations do phase 8 in the "compiler", however.)
(Note that the above are really technical details. For a user
lambda, Jerry's statement is correct.)