0

I have been using a graphics library from Smaller Animals Software called ImgSource. Unfortunately, Smaller Animals Software has closed and is no longer available to answer questions. Recently, I had a system failure that deleted my only up-to-date copy of the library (I thought I had a backup but was wrong). I did, however, have the source code. I recompiled the library, both release and debug. (Both are static .lib files) I am also using MSVS 2019 Community edition and the project is an MFC project. The problem, and why I'm posting here, is that when I link the new release library with a previous project, the project compiles properly. However, when I build the debug version, it will compile, but not link and produces the linker error discussed LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in file.obj

A reasonable conclusion is that there is something wrong with the debug library. However, if I build a new project and link the debug library, everything works fine. So, the error does not appear to be in the library. It seems I could start from scratch and completely redo these projects, but they do reflect a tremendous amount of work.

I can't figure out how to modify the settings in the existing projects so that they will compile in debug mode. I have tried the suggestions offered in the article referenced above. Further suggestions would be greatly appreciated.

  • The project and the library should be built with the same [Use Run-Time Library](https://learn.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library) setting. Apparently, you have a mismatch. Check this setting in all configurations of all projects. – Igor Tandetnik Jul 19 '21 at 12:34
  • I have checked and run the gamut of combinations. For new projects, the program compiles, and the graphics library links just fine. For some, but not all, older programs, things compile and link properly in the Release build, but not in the Debug build where the error message appears. That's what's so perplexing. – DiverRon Jul 21 '21 at 16:02

0 Answers0