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

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
tuk1
Earned some good credits
Earned some good credits
Posts: 114
Joined: Sun Oct 08, 2017 9:36 am

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

Post 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 4758 times
wxWidgets(v3.2.2.1) - Vs2022(v143) - Win10(x64) - DialogBlocks(v5.16.5_Unicode)
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

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

Post 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).
tuk1
Earned some good credits
Earned some good credits
Posts: 114
Joined: Sun Oct 08, 2017 9:36 am

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

Post 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.
wxWidgets(v3.2.2.1) - Vs2022(v143) - Win10(x64) - DialogBlocks(v5.16.5_Unicode)
drdrbergman
In need of some credit
In need of some credit
Posts: 5
Joined: Mon Oct 28, 2019 6:30 pm

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

Post 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?
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

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

Post 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.
drdrbergman
In need of some credit
In need of some credit
Posts: 5
Joined: Mon Oct 28, 2019 6:30 pm

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

Post 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 3762 times
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

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

Post 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.
Use the source, Luke!
drdrbergman
In need of some credit
In need of some credit
Posts: 5
Joined: Mon Oct 28, 2019 6:30 pm

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

Post 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.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

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

Post 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)?
Use the source, Luke!
drdrbergman
In need of some credit
In need of some credit
Posts: 5
Joined: Mon Oct 28, 2019 6:30 pm

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

Post 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.
tuk1
Earned some good credits
Earned some good credits
Posts: 114
Joined: Sun Oct 08, 2017 9:36 am

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

Post 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
wxWidgets(v3.2.2.1) - Vs2022(v143) - Win10(x64) - DialogBlocks(v5.16.5_Unicode)
Post Reply