Page 1 of 1

Fatal Runtime Error: Mismatch between the program and library build versions detected.

Posted: Tue Oct 23, 2018 2:41 pm
by tuk1
Not sure how to resolve this runtime error, have tried updating library from 3.0.3 to 3.0.4 and rebuilding project but it didn't help.
Mismatch between the program and library build versions detected. The library used 3.0 (wchar_t, Visual C++ 1900, wx containers, compatible with 2.8 and your program used 3.0 (wchar_t, Visual C++ 1915, wx containers, compatible with 2.8
Capture.JPG
Capture.JPG (26.68 KiB) Viewed 3004 times

Re: Fatal Runtime Error: Mismatch between the program and library build versions detected.

Posted: Tue Oct 23, 2018 3:46 pm
by PB
1900 = MSVC 2015 v14.0
1915 = MSVC 2017 v15.8

Assuming you really used the same compiler (MSVC 2017) for both the library and the application using it, make sure the platform toolset (in project settings, Configuration Properties / General) is also the same (e.g. v140 vs 141).

Re: Fatal Runtime Error: Mismatch between the program and library build versions detected.

Posted: Tue Oct 23, 2018 4:06 pm
by tuk1
PB wrote: Assuming you really used the same compiler (MSVC 2017) for both the library and the application using it
=D> ...doh! can't believe I missed that, I've not long moved from vs2015 to vs2017 and still have the old cmd shortcut lurking in my start menu.

Re: Fatal Runtime Error: Mismatch between the program and library build versions detected.

Posted: Mon Oct 28, 2019 6:33 pm
by drdrbergman
I just had the same issue arise while trying to run the wxplplot example in plplot. I built the widgets and plplot libs/dlls with the exact same compiler as the example and there are no other widgets distributions on my computer. Could there be another cause and solution?

Re: Fatal Runtime Error: Mismatch between the program and library build versions detected.

Posted: Tue Oct 29, 2019 12:05 am
by stahta01
drdrbergman wrote:
Mon Oct 28, 2019 6:33 pm
I just had the same issue arise while trying to run the wxplplot example in plplot. I built the widgets and plplot libs/dlls with the exact same compiler as the example and there are no other widgets distributions on my computer. Could there be another cause and solution?
The same type of problem happens when you use different compiler options. I forget which few options can cause this issue.
But, it would likely very per compiler.

Note: If you have the same exact error message you need to decide which compiler you want to use and fix the error message by using that compiler!

Tim S.

Re: Fatal Runtime Error: Mismatch between the program and library build versions detected.

Posted: Tue Oct 29, 2019 5:50 pm
by drdrbergman
Thank you Tim. I suspected as much after reading a few stackoverflow and other blog posts. However, I just purged everything and did a clean rebuild of widgets and plplot this time making sure that the same SDk and compiler choice was made in all projects. I did have 2 SDK's and it seems that widgets and plplot had populated the projects with different choices (at least that is what seems to be the case). After the complete rebuild and install the same error came up (I compiled the test project with the same choices too).

As you can see the mismatch is not between two versions but between two different containers, wx and STL. My knowledge of some of these details is weak. Any suggestions?
Error.png
Error.png (10.01 KiB) Viewed 2008 times

Re: Fatal Runtime Error: Mismatch between the program and library build versions detected.

Posted: Tue Oct 29, 2019 7:04 pm
by doublemax
The "wx/stl containers" in the message refers to the "wxUSE_STD_CONTAINERS" #define in setup.h

This indicates that there are still two different configurations used when building the libs vs the app.

Re: Fatal Runtime Error: Mismatch between the program and library build versions detected.

Posted: Tue Oct 29, 2019 11:27 pm
by drdrbergman
What could be different if all things that I can control (or at least know about) are the same?
The SDK and compiler versions were identical. Is there some other setting that I could check, say preprocessor settings?
Any help would be appreciated.

Re: Fatal Runtime Error: Mismatch between the program and library build versions detected.

Posted: Tue Oct 29, 2019 11:47 pm
by doublemax
Check the include paths to wxWidgets and preprocessor settings in both projects.

BTW: How exactly do you build both projects (wx libs and the sample)?

Re: Fatal Runtime Error: Mismatch between the program and library build versions detected.

Posted: Wed Oct 30, 2019 4:31 pm
by drdrbergman
For widgets I use the VS sln that comes with it. Plplot build uses cmake then the install uses a VS sln.
I did catch a discrepancy between the SDK setting that was default setting in each a while back but that is fixed.
The example is from the plplot distribution but I did not build it with the rest of plplot. I made a new VS project and did a cut and paste.

I can get each to work on its own, and I've had a bit of trouble with the plplot install for a while but that is fixed too. Thanks for your advice. I'm pretty sure the include paths in my project are pointing to the correct but I'm not sure about the wx and pl builds or the preprocessor settings.

Re: Fatal Runtime Error: Mismatch between the program and library build versions detected.

Posted: Tue Dec 17, 2019 8:03 pm
by tuk1
This error usually appears following a change or update to vs.

The solution for me is rebuild wxWidgets libraries via dev cmd:
cd /d %WXWIN%\build\msw
nmake /a makefile.vc