Question

I have VS 2008 and I want my application to work with Windows 98 without needing to include MSVCR90.dll .. Win98 comes with MSVCR60 so how could I tell MSVC to do this? Is my only option to hunt down Visual studio 6?

Thanks

*also I want to avoid static linking msvcr

Was it helpful?

Solution

You can't tell Visual Studio to use an earlier version of the runtime library. Even if you can get it to compile with the old library, the application itself is not going to run correctly because the compiler is going to insert calls to functions it expects to be in the library, which might not be the case.

also I want to avoid static linking msvcr
Why? That seems like a perfectly valid solution to this problem. Sure, you pay about 100kb in code size for it, but that's worth it over being forced to use Visual Studio 6's buggy and nonconforming compiler.

You could also just include the MSVC++ redistributable which would contain the correct DLLs and wouldn't require static linking of the standard library.

OTHER TIPS

If you want to target Windows 98, your options are:

  • First, a maximum version of Visual Studio 2005. 2008 and up stamp an minimum OS ver of 5.0 in the EXE header - Windows 98 will simply not load binaries produced by VS 2008.

As to the CRT distribution:

  • Distribute the new runtime with your app. I prefer this approach if your app has many dlls as static linking makes the whole lot larger than it needs to be. Plus there are a lot of restrictions to using c++ from dll's that are eased if you at least share a c-runtime implementation between all modules in a process.

If you are not a "heavy" user of c++ features like exceptions, and the STL, you might be able to get away with not linking in any crt at all. Otherwise your options are:

  1. Use a non MS compiler like MinGW. MinGW uses the latest GCC so you get C99 and C++98, C++03, TR1 etc. And it uses msvcrt.dll. Code::Blocs is an "ok" IDE, if youve never used Visual Sutdio and/or have taken a few too many blows to the head.
  2. Download the Windows DDK. You'll need to build from the command line, and get dirty with make files, but its free, and the DDK uses the VS2005 compiler & linker, but specially setup to link against msvcrt.dll, NOT msvcr80.dll. It was deemed too risky requiring device drivers to link against a runtime that might not be there.
  3. Visual Studio 6 as the final fallback option. Horrible Horrible support for C++98. At least you get a pretty IDE and it should be damn fast now that computers have theoretically doubled in speed/capacity 8 times since it was launched.

The Low Overhead Microsoft Visual Studio C Runtime is a statically linkable C Runtime which makes maximum use of the available DLL's already distributed with Windows.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top