LYR-LNK0002
a library the linker does not find
Reported by build, run, test and bench when the linker finds no library by a name a package's [native] part, its build script or pkg-config gave it, or no macOS framework by its name. The finding stands at the line of the manifest that names it, or says who named it. Nothing is linked; the exit code is 2.
Explanation
A library named in libs — or by a build script's linkLib, or in what pkg-config answered — is looked for by the linker in the system's directories and those the build was told of. When it is not there, the link fails at once.
On Linux and macOS the library is often installed without what a link needs: install its development package (libsqlite3-dev, sqlite-devel), or let pkgConfig find it, which also says the directory. A library in a directory of its own is named by a build script with linkSearch. A misspelt name — sqlite for sqlite3 — fails the same way. A framework is the macOS SDK's; its name is the SDK's, with its capital letters.
Example
$ cat lyric.toml
[package]
name = "app"
version = "0.1.0"
[native]
libs = ["sqlite"]
$ lyric5 build
error[LYR-LNK0002]: the linker finds no library 'sqlite'
--> lyric.toml:6:9
|
6 | libs = ["sqlite"]
| ^^^^^^^^ app names it here
|
= help: install its development package, or name the directory that holds it — pkg-config says both ('pkgConfig'), a build script 'linkSearch'