[Speex-dev] Static linking without C runtime dependence?

Thorvald Natvig speex at natvig.com
Sun Oct 16 18:59:51 PDT 2005

>> What you want is simply to override some of the functions in misc.c. I made 
>> it easy to do by wrapping malloc() a speex_alloc() call. Aside from what's 
>> in misc.c, the only other thing I use are some of the math functions like 
>> cos().
> That makes sense.  But how does the DLL version, which is not linked to the C 
> runtime, get access to C's transcendental like cos() ??

Depending on what compiler and settings you use, the C runtime will be 
included either dynamically or statically in the dll file. My libspeex.dll 
is linked to MSVCRT.DLL (MS Visual C RunTime) when built with MinGW.

Your statically compiled libspeex can be set to depend 
on a dll-loaded runtime (in msvcrt.dll), and as your process will 
indirectly link to msvcrt if you use directsound or any other modern 
library, that's probably the easiest solution.

More information about the Speex-dev mailing list