Good question. Compared to other distributions, Debian is notorious in changing package names from their upstream forms in order to comply to Debian policy. This brings advantages as well as disadvantages. Debian packages are much more consistently named (e.g. names of all library packages start with lib). OTOH, the Debian names often differ from what is specified in upstream documentation. All this applies to Ubuntu and other Debian derivatives because they follow Debian naming conventions.
Quoting from Debian policy, 5.6.1. Source:
Package names (both source and binary, see
Package) must consist only of lower case letters (a-z), digits (0-9), plus (+) and minus (-) signs, and periods (.). They must be at least two characters long and must start with an alphanumeric character.
Now, from 8.1. Run-time shared libraries:
Normally, the run-time shared library and its SONAME symlink should be placed in a package named libraryname
soversion, where
soversion is the version number in the SONAME of the shared library. Alternatively, if it would be confusing to directly append
soversion to libraryname (if, for example, libraryname itself ends in a number), you should use libraryname-
soversion instead.
The latter probably sounds confusing to you. As a matter of fact, if you often build from source, you'll get the hang of it pretty quickly.
To find out the name of a package, I find apt-cache pkgnames very useful. Actually, I have an alias for it
Code:
$ alias acn
alias acn='apt-cache pkgnames'
So, back to your question. First, as I said all library packages start in lib. Next, headers and symlinks needed to link against a library when building from source are in -dev packages.
Code:
$ acn libsdl2|grep dev$
libsdl2-mixer-dev
libsdl2-image-dev
libsdl2-gfx-dev
libsdl2-dev
libsdl2-ttf-dev
libsdl2-net-dev
Code:
$ acn libopenal|grep dev$
libopenal-dev
Code:
$ acn ninja
ninja-build
Finding the package for wxWidgets is a bit more involved. If acn doesn't give me any results or they're not immediately obvious, I use apt-cache search (aliased to acs):
Code:
$ alias acs
alias acs='apt-cache search'
Code:
$ acs wxWidgets dev|grep ^lib
libwxbase3.0-dev - wxBase library (development) - non-GUI support classes of wxWidgets toolkit
libwxgtk-media3.0-gtk3-dev - wxWidgets Cross-platform C++ GUI toolkit (GTK 3 media library development)
libwxgtk-webview3.0-gtk3-dev - wxWidgets Cross-platform C++ GUI toolkit (GTK 3 webview library development)
libwxgtk3.0-gtk3-dev - wxWidgets Cross-platform C++ GUI toolkit (GTK 3 development)
libwxsqlite3-3.0-dev - Development files for wxSQLite3
libwxsvg-dev - Development files for wxSVG
The description usually will give you a clue. If you are not sure which one of the displayed packages you need then just install all of them.
Sometimes, rather than building from scratch you just want to build a newer version of a package that is already present in Ubuntu. In this case, use apt build-dep <package_name> to install its dependencies.