OPENGL32.dll and MSVCRT.dll missing functions

My app’s exe calls c:\windows\system32\OPENGL32.dll (Version 6.0.6000.16386) which calls _ftol2, _except_handler4 and other functions in c:\windows\system32\MSVCRT.dll

But depending on the version of MSVCRT.dll shipped with Windows Xp or Vista, the function _ftol2 may or may not be present.

And if I manually replace the MSVCRT.dll in windows\system32 with the version with the _ftol2 function, I get blue screen upon restart.

How to resolve? Thanks

  1. Do NOT replace ANY dll’s in your system.
    Even if you get it working this way, you will have to ask your customers to do the same to get your application running. As a customer I would never use such application and tell the developer to learn making software.

  2. You must provide MSVCRT.dll from your Visual Studio to the user - put it in you application directory.
    You may also provide user with MSVC redistributable package - it’s a small exe, provided by Microsoft, that installs these dll’s in proper place.
    Providing them in application directory seems simplier and is often used.

  3. You may also recompile your app (change project setting) to use static-linked runtime library instead of dll-runtime library.
    This is good for small applications.
    Larger applications, that are split into several dll’s should use dll-runtime library.

These are the basics of distributing applications writen using MS Visual Studio and have nothing to do with OpenGl itself.

As for opengl32.dll - all that is required is for user to install graphics drivers.