Warning: Mismatch between the program and library build versions detected.

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.
bgining2this
Knows some wx things
Knows some wx things
Posts: 29
Joined: Wed Mar 03, 2021 9:24 pm

Warning: Mismatch between the program and library build versions detected.

Post by bgining2this »

Hello community.-

I am compiling a wxwidgets app with CodeLite ide and wxcraft, it is a MDI application, but when i build it this error is shown.-

./DentalOrganizer
15:16:41: Warning: Mismatch between the program and library build versions detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1014,wx containers,compatible with 2.8),
and your program used 3.0 (wchar_t,compiler with C++ ABI 1010,wx containers,compatible with 2.8).

I had different versions os wxWidgets in the past but i have deleted one of them and developing on version 3, i use Arch Linux, any help is appreciated and thanks!!
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Warning: Mismatch between the program and library build versions detected.

Post by DavidHart »

Hi,

What are your project's compiler and linker settings? In particular, do they contain 'wx-config --<whatever>' or '/path/to/wx-config --<whatever>'?

What is the result of doing, in a terminal:

Code: Select all

wx-config --list
wx-config --cxxflags
wx-config --libs all
Regards,

David
bgining2this
Knows some wx things
Knows some wx things
Posts: 29
Joined: Wed Mar 03, 2021 9:24 pm

Re: Warning: Mismatch between the program and library build versions detected.

Post by bgining2this »

The compiler and linker settings are the default of codelite here it is the output of the 3 commands you asked

Code: Select all

wx-config --list

    Default config is gtk2-unicode-3.1

  Default config will be used for output

Code: Select all

wx-config --cxxflags
-I/usr/local/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/include/wx-3.1 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread

Code: Select all

wx-config --libs all
-L/usr/local/lib -pthread   -lwx_gtk2u_xrc-3.1 -lwx_gtk2u_webview-3.1 -lwx_gtk2u_stc-3.1 -lwx_gtk2u_richtext-3.1 -lwx_gtk2u_ribbon-3.1 -lwx_gtk2u_propgrid-3.1 -lwx_gtk2u_aui-3.1 -lwx_gtk2u_gl-3.1 -lwx_gtk2u_html-3.1 -lwx_gtk2u_qa-3.1 -lwx_gtk2u_core-3.1 -lwx_baseu_xml-3.1 -lwx_baseu_net-3.1 -lwx_baseu-3.1
As you can see in the output of this commands im using version 3.1 of wxwidgets for what i can see, thank you for the help
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Warning: Mismatch between the program and library build versions detected.

Post by DavidHart »

The wx-config output looks sane, and gives no reason to suppose that multiple wx versions are currently installed. However, where did that wx3.1 build come from? Did you self-build, or is it from Arch?

And did you ever have >1 wx3.1 build installed to /usr/local? If so, there might still be stale libs there. Or even stale headers: a search result implied that using the wrong /usr/include/wx-* (or, in your case, /usr/local/include/wx-* too) would cause this warning.
That would also explain why the warning message says "...used 3.0" rather than 3.1.
The compiler and linker settings are the default of codelite
Codelite has different types of project, though, and they don't all use wxWidgets. Please tell us what your entries are.
And if you've not already fixed the problem, I suggest you try adding a new C++ 'GUI with wxWidgets and wxCrafter' project to your workspace, and see if building that gives the same result.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Warning: Mismatch between the program and library build versions detected.

Post by stahta01 »

What does these three commands return?

Code: Select all

pacman -Q wxgtk-common
pacman -Q wxgtk2
pacman -Q wxgtk3
Tim S.
bgining2this
Knows some wx things
Knows some wx things
Posts: 29
Joined: Wed Mar 03, 2021 9:24 pm

Re: Warning: Mismatch between the program and library build versions detected.

Post by bgining2this »

This is the output for those commands.-

Code: Select all

 ✝  ~  pacman -Q wxgtk-common
wxgtk-common 3.0.5.1-2
 ✝  ~  pacman -Q wxgtk2      
wxgtk2 3.0.5.1-2
 ✝  ~  pacman -Q wxgtk3
wxgtk3 3.0.5.1-2
 ✝  ~  
Yes i had created the project like a wxwidgets and wxCrafter solution thank you
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Warning: Mismatch between the program and library build versions detected.

Post by DavidHart »

pacman -Q wxgtk-common
wxgtk-common 3.0.5.1-2
pacman -Q wxgtk2
wxgtk2 3.0.5.1-2
pacman -Q wxgtk3
wxgtk3 3.0.5.1-2
So you do have wx3.0.5 libs on your system, and presumably they are being found by the linker when your project is being built.

Solutions include:
1) Remove those packages. However other wx programs may depend on them...

2)Fix your Project's Linker Settings. You still haven't revealed what they are, but I suspect you'll find that you can fix the problem by using something like:
Linker Options: $(shell /usr/local/bin/wx-config --libs --unicode=yes)
or alternatively by putting something sensible into the 'Libraries Search Path' field.
bgining2this
Knows some wx things
Knows some wx things
Posts: 29
Joined: Wed Mar 03, 2021 9:24 pm

Re: Warning: Mismatch between the program and library build versions detected.

Post by bgining2this »

Same thing David, same error/warning shows and i cant see the two frames i have created, i compile fine, but i cant see any frame when i execute the program, thank you
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Warning: Mismatch between the program and library build versions detected.

Post by DavidHart »

What did you do? Remove the wx3.0 packages? Enter that Linker setting? Fill the Libraries Search Path field? Or all three?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Warning: Mismatch between the program and library build versions detected.

Post by ONEEYEMAN »

Hi,
Can you compile and run "minimal" sample provided by the library?
If you are - make sure that the command used to compile it is the same as the command inside the IDE...

Thank you.
bgining2this
Knows some wx things
Knows some wx things
Posts: 29
Joined: Wed Mar 03, 2021 9:24 pm

Re: Warning: Mismatch between the program and library build versions detected.

Post by bgining2this »

if i remove the packages i wouldnt be able to open CodeLite, i have modified the Linker settings, the error is still showing, and i cant also see my 2 windows i have created :(
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Warning: Mismatch between the program and library build versions detected.

Post by DavidHart »

if i remove the packages i wouldnt be able to open CodeLite
Ah. You presumably have the CodeLite Arch package installed.

I don't use Arch, so I can't guess what Arch-specific things might be going wrong. A fix for one possible cause would be to re-install your wx3.1, this time to /usr/ instead of /usr/local. You can do that by adding --prefix=/usr to your configure line. That makes it more likely that the correct wx-config will be found. However that's only a guess, without enough information about your settings or being able to test things here.
Perhaps an Arch forum...
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Warning: Mismatch between the program and library build versions detected.

Post by ONEEYEMAN »

Hi,
Or you can try to set the absolute path to wx-config (as a test).

Thank you.
bgining2this
Knows some wx things
Knows some wx things
Posts: 29
Joined: Wed Mar 03, 2021 9:24 pm

Re: Warning: Mismatch between the program and library build versions detected.

Post by bgining2this »

I did it, now everything is fine, i have uninstalled everything and installed version 3.1 (all the dev ones), and in order for codelite to work the package named lib32-wxgtk3 so now i have the last version and codelite works ok. The compiler throwed me 10 errors or more, can you help me with those or i need to open a new thread ?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Warning: Mismatch between the program and library build versions detected.

Post by ONEEYEMAN »

Hi,
1. So is everything works or you still have errors? ;-)
2. If you do have errors:
2a do they come from building CodeLite or your own code?
2b. what are those errors?

Thank you.
Post Reply