SQLite Forum

What am I doing wrong to get errors when trying to compile amalgamation file in Linux
Login
Theoretically you do not need those on Windows (with a MinGW compiler) because those functions (dynamic loading and threading) are natively handled by the NT Kernel (KERNEL32.DLL trampoline) and thus do not need to be present in the link since the Kernel Runtime is always present and a compiler designed to produce "native" Win32 code does not require runtime support for those functions.

You will note that -mthreads (enables thread exception propagation to the main thread) does require runtime library support, but in some versions of MinGW that support code is hauled in automatically during linking and depending on the version of MinGW may always be present even if not specified (since such propagation is a native Win32 function to some extent).

On Linux however, the threading and dynamic linking routines are runtime functions and not native functions (as in the compiler does not generate the syscalls directly), therefore you must haul in the runtime support libraries.