d3dx9_42.dll

Started by
21 comments, last by Evil Steve 13 years, 6 months ago
Quote:Original post by ProgrammerDX
Ok but that doesn't need a redistributable package
Yes it does. The CRT is the C Runtime Library, which contains all the implementation of functions like strlen, malloc, localtime, printf, and so on. If you're using main or WinMain in your app, then your applications entry point is mainCRTStartup() or winmainCRTStartup(). Those functions set up various CRT state, such as initialising the heap so malloc and new can function, and then call main() or WinMain() - and those functions require the CRT to use.
You can put a breakpoint on the first line of main() / WinMain() and then look at the call stack and you'll see that the previous function in the stack is the CRT startup function.

Without using the CRT, you can't use any C functions, only functions exposed by kernel32.dll. So you'd need to use VirtualAlloc to allocate a chunk of memory and then implement new to use that chunk of memory instead of delegating to malloc as the default does.

The reason you might not think you need the VC redist package, is that a lot of other applications are written using Visual Studio, and one of them has probably installed the runtime libraries you need - but you can't rely on it.
Advertisement
CRT is a static library, atleast with Visual Studio, no linking with a DLL at all
Quote:Original post by ProgrammerDX
CRT is a static library, atleast with Visual Studio, no linking with a DLL at all
By default, Visual Studio 2005 onwards (Possibly VC2003, I'm not sure) will link to the DLL version of the CRT. You can always change that to the static library in your linker settings though, yes.

This topic is closed to new replies.

Advertisement