Mismatch between the program and library build versions 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
Alex Farber
Earned a small fee
Earned a small fee
Posts: 24
Joined: Wed Mar 03, 2010 9:27 am

Mismatch between the program and library build versions

Post by Alex Farber » Sun Mar 14, 2010 11:11 am

I built wxWidgets on Linux using the following commands:
../configure --enable-shared --disable-debug

It see results of this build:
/usr/local/lib/wx/config/gtk2-ansi-release-2.8
/usr/local/lib/wx/include/gtk2-ansi-release-2.8/wx/setup.h

wx-config output:

Code: Select all

[email protected]:~$ wx-config --list
    Default config is gtk2-ansi-release-2.8
  Default config will be used for output
  Alternate matches:
    gtk2-ansi-debug-2.8
    gtk2-ansi-debug-static-2.8
    gtk2-ansi-release-static-2.8
[email protected]:~$ wx-config --cppflags --release
2.8
-I/usr/local/lib/wx/include/gtk2-ansi-release-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__
[email protected]:~$ wx-config --libs --release
2.8
-L/usr/local/lib -pthread   -lwx_gtk2_richtext-2.8 -lwx_gtk2_aui-2.8 -lwx_gtk2_xrc-2.8 -lwx_gtk2_qa-2.8 -lwx_gtk2_html-2.8 -lwx_gtk2_adv-2.8 -lwx_gtk2_core-2.8 -lwx_base_xml-2.8 -lwx_base_net-2.8 -lwx_base-2.8 
Now I am trying to build Hello wxWidgets program with Release version:

Code: Select all

g++ -I/usr/local/lib/wx/include/gtk2-ansi-release-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ hello.cpp -o hello -L/usr/local/lib -pthread   -lwx_gtk2_richtext-2.8 -lwx_gtk2_aui-2.8 -lwx_gtk2_xrc-2.8 -lwx_gtk2_qa-2.8 -lwx_gtk2_html-2.8 -lwx_gtk2_adv-2.8 -lwx_gtk2_core-2.8 -lwx_base_xml-2.8 -lwx_base_net-2.8 -lwx_base-2.8
It compiles and runs successfully on my computer. Program dependencies:

Code: Select all

[email protected]:/media/Shared/Widgets/Documents/Installation2/SampleApplication$ ldd hello
	linux-gate.so.1 =>  (0x006ef000)
	libwx_gtk2_richtext-2.8.so.0 => /usr/local/lib/libwx_gtk2_richtext-2.8.so.0 (0x00253000)
	libwx_gtk2_aui-2.8.so.0 => /usr/local/lib/libwx_gtk2_aui-2.8.so.0 (0x005ff000)
	libwx_gtk2_xrc-2.8.so.0 => /usr/local/lib/libwx_gtk2_xrc-2.8.so.0 (0x00110000)
	libwx_gtk2_qa-2.8.so.0 => /usr/local/lib/libwx_gtk2_qa-2.8.so.0 (0x00a3c000)
	libwx_gtk2_html-2.8.so.0 => /usr/local/lib/libwx_gtk2_html-2.8.so.0 (0x0019d000)
	libwx_gtk2_adv-2.8.so.0 => /usr/local/lib/libwx_gtk2_adv-2.8.so.0 (0x00c18000)
	libwx_gtk2_core-2.8.so.0 => /usr/local/lib/libwx_gtk2_core-2.8.so.0 (0x00ef8000)
	libwx_base_xml-2.8.so.0 => /usr/local/lib/libwx_base_xml-2.8.so.0 (0x0047e000)
	libwx_base_net-2.8.so.0 => /usr/local/lib/libwx_base_net-2.8.so.0 (0x00353000)
	libwx_base-2.8.so.0 => /usr/local/lib/libwx_base-2.8.so.0 (0x006f0000)
    ...
Now I want to execute this program on another computer without wxWidgets installed. I copy the program and all shared libraries to another computer:

Code: Select all

hello                        libwx_gtk2_core-2.8.so
libwx_base-2.8.so            libwx_gtk2_core-2.8.so.0
libwx_base-2.8.so.0          libwx_gtk2_core-2.8.so.0.6.0
libwx_base-2.8.so.0.6.0      libwx_gtk2_html-2.8.so
libwx_base_net-2.8.so        libwx_gtk2_html-2.8.so.0
libwx_base_net-2.8.so.0      libwx_gtk2_html-2.8.so.0.6.0
libwx_base_net-2.8.so.0.6.0  libwx_gtk2_qa-2.8.so
libwx_base_xml-2.8.so        libwx_gtk2_qa-2.8.so.0
libwx_base_xml-2.8.so.0      libwx_gtk2_qa-2.8.so.0.6.0
libwx_base_xml-2.8.so.0.6.0  libwx_gtk2_richtext-2.8.so
libwx_gtk2_adv-2.8.so        libwx_gtk2_richtext-2.8.so.0
libwx_gtk2_adv-2.8.so.0      libwx_gtk2_richtext-2.8.so.0.6.0
libwx_gtk2_adv-2.8.so.0.6.0  libwx_gtk2_xrc-2.8.so
libwx_gtk2_aui-2.8.so        libwx_gtk2_xrc-2.8.so.0
libwx_gtk2_aui-2.8.so.0      libwx_gtk2_xrc-2.8.so.0.6.0
libwx_gtk2_aui-2.8.so.0.6.0
And run it:
LD_LIBRARY_PATH=. ./hello

Result:

Code: Select all

Fatal Error: Mismatch between the program and library build versions detected.
The library used 2.8 (debug,ANSI,compiler with C++ ABI 1002,wx containers,compatible with 2.6),
and your program used 2.8 (no debug,ANSI,compiler with C++ ABI 1002,wx containers,compatible with 2.6).
./run.sh: line 1:  1810 Aborted                 LD_LIBRARY_PATH=. ./hello
What is wrong?

Alex Farber
Earned a small fee
Earned a small fee
Posts: 24
Joined: Wed Mar 03, 2010 9:27 am

Post by Alex Farber » Mon Mar 15, 2010 7:41 am

Solved by using static release flags. Not exactly what I want, but it is working.

DavidHart
Site Admin
Site Admin
Posts: 3881
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart » Mon Mar 15, 2010 10:12 am

Hi Alex,

This is the sort of thing that can happen when you have multiple wx builds installed in the same place; and is why I use the method described in your previous thread.

Regards,

David

Alex Farber
Earned a small fee
Earned a small fee
Posts: 24
Joined: Wed Mar 03, 2010 9:27 am

Post by Alex Farber » Mon Mar 15, 2010 1:03 pm

Thank you, I keep your answer as a reference for Widgets build :)

guyanqiu
Knows some wx things
Knows some wx things
Posts: 25
Joined: Sun Jun 13, 2010 2:44 pm

Re: Mismatch between the program and library build versions

Post by guyanqiu » Fri Sep 02, 2011 5:16 am

Code: Select all

Fatal Error: Mismatch between the program and library build versions detected.
The library used 2.8 (debug,ANSI,compiler with C++ ABI 1002,wx containers,compatible with 2.6),
and your program used 2.8 (no debug,ANSI,compiler with C++ ABI 1002,wx containers,compatible with 2.6).
./run.sh: line 1:  1810 Aborted                 LD_LIBRARY_PATH=. ./hello
I met this problem,and I solved it by update the new include files.
Should keep the include and the lib folders match.
The include and lib folders must the ones you compiled.
I install wxWidgets2.8.10,2.8.12,2.9.2 with the wxDev-C++,they now can work well.

Post Reply