These aren't the libraries you're looking for ... 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.
wxTNewb
Knows some wx things
Knows some wx things
Posts: 28
Joined: Tue Sep 04, 2007 3:57 pm

These aren't the libraries you're looking for ...

Post by wxTNewb »

For some reason, the libraries I think I'm using aren't the ones I'm using...

New install of Ubuntu.

Whenever I try to run my program I get this:

Code: Select all

Fatal Error: Mismatch between the program and library build versions detected.
The library used 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6),
and your program used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6).
Aborted
In the compile options (Code::blocks) I have it using wx-config --cflags, and in link wx-config --libs

Code: Select all

user@localhost:~/Projects/$ wx-config --cflags
-I/usr/lib/wx/include/base-unicode-debug-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -DwxUSE_GUI=0 -pthread
user@localhost:~/Projects/ wx-config --libs
-pthread -Wl,-Bsymbolic-functions  -lwx_baseud_xml-2.8 -lwx_baseud_net-2.8 -lwx_baseud-2.8 
user@localhost:~/Projects/ wx-config --version
2.8.9
As far as I can tell, I should be linking to the debug libraries, but it claims I compiled with release... What am I doing wrong?
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am

Post by Auria »

Hi,

how did you install wxWidgets?
wxTNewb
Knows some wx things
Knows some wx things
Posts: 28
Joined: Tue Sep 04, 2007 3:57 pm

Post by wxTNewb »

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am

Post by Auria »

where precisely is the mismtach is hard to tell;

maybe try :

Code: Select all

 wx-config --list
to see if you have multiple wxWidget configurations installed.
wxTNewb
Knows some wx things
Knows some wx things
Posts: 28
Joined: Tue Sep 04, 2007 3:57 pm

Post by wxTNewb »

Indeed that is the case...

Code: Select all

user@localhost:~$ wx-config --list

    Default config is base-unicode-debug-2.8

  Default config will be used for output

  Alternate matches:
    base-unicode-release-2.6
    base-unicode-release-2.8
    gtk2-unicode-debug-2.8
But .. The selected default, which is confirmed in the above listing, is the one I want, it's the one I instructed to link against, it is the one the system is trying to use, yet it claims that the release build was linked to.

The wx-config --libs clearly shows it's trying to link against unicode debug... I'm at a loss as to why the executable claims to have been built without debugging symbols.
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart »

Hi,
Default config is base-unicode-debug-2.8
Base is for console apps; you need the gui version. It seems that Intrepid is prone to making this poor choice of default.

You can use update-alternatives to select gtk2-unicode-debug-2.8 instead.

Regards,

David
wxTNewb
Knows some wx things
Knows some wx things
Posts: 28
Joined: Tue Sep 04, 2007 3:57 pm

Post by wxTNewb »

Don't know if it's an improvement or not! Now it won't compile, complaining that wxCheckListBox is undefined.

Odd... I would think in Console it would be undefined and in gtk2 it would work fine...

Code: Select all

/home/user/Projects/bst/wxPackageBox.h:8: error: expected class-name before ‘{’ token
Code snippit

Code: Select all

#pragma once

#include <wx/wx.h>
#include <wx/checklst.h>

class wxPackageBox :
  public wxCheckListBox
{
public:
  wxPackageBox(wxWindow *parent, wxWindowID id,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 int nStrings = 0,
I changed the config from

Code: Select all

wx-config --cflags
to

Code: Select all

`wx-config --version gtk2-unicode-debug-2.8 --cflags`
Something doesn't seem right... when I try the command in shell, I get this output:

Code: Select all

user@localhost:~$ wx-config --cflags --version gtk2-unicode-debug-2.8
2.8.9
-I/usr/lib/wx/include/base-unicode-debug-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -pthread
user@localhost:~$ wx-config --cflags 
-I/usr/lib/wx/include/base-unicode-debug-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -DwxUSE_GUI=0 -pthread
I guess I'm using wx-config improperly...
wxTNewb
Knows some wx things
Knows some wx things
Posts: 28
Joined: Tue Sep 04, 2007 3:57 pm

Post by wxTNewb »

Well, figured out it's --toolkit, not --version! hehe

Anyways, it didn't fix the original error. =(

Code: Select all

user@localhost:~/Projects/DPS$ wx-config --toolkit=gtk2 --cflags
-I/usr/lib/wx/include/gtk2-unicode-debug-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXGTK__ -pthread
user@localhost:~/Projects$ wx-config --toolkit=gtk2 --libs
-pthread -Wl,-Bsymbolic-functions  -lwx_gtk2ud_richtext-2.8 -lwx_gtk2ud_aui-2.8 -lwx_gtk2ud_xrc-2.8 -lwx_gtk2ud_qa-2.8 -lwx_gtk2ud_html-2.8 -lwx_gtk2ud_adv-2.8 -lwx_gtk2ud_core-2.8 -lwx_baseud_xml-2.8 -lwx_baseud_net-2.8 -lwx_baseud-2.8 
user@localhost:~/Projects$ bin/Debug/Project
Fatal Error: Mismatch between the program and library build versions detected.
The library used 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6),
and your program used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6).
Aborted
But I'm sure I needed to make that fix before anyhow.
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart »

You can use update-alternatives to select the correct alternative permanently. I'd be surprised if it didn't work then, using just the standard wx-config invocations.
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am

Post by Auria »

It's unclear from your post if you used "wx-config --toolkit=gtk2" to re-build your project; simply calling "wx-config --toolkit=gtk2 --cflags" on the terminal won't change your project
wxTNewb
Knows some wx things
Knows some wx things
Posts: 28
Joined: Tue Sep 04, 2007 3:57 pm

Post by wxTNewb »

It's unclear from your post if you used "wx-config --toolkit=gtk2" to re-build your project; simply calling "wx-config --toolkit=gtk2 --cflags" on the terminal won't change your project
I'm using the terminal to show what the options passed are. It is quite clearly stated in line 8 of the original post:
In the compile options (Code::blocks) I have it using wx-config --cflags, and in link wx-config --libs
I didn't think it necessary to repeat that every time, but copied the output from the commands into the post for clarity as to what was being passed to the compiler. It's also "unclear" from the posts if I'm compiling the code each time I make a change. I am.

However... Whatever the default is supposed to be and what it is are completely different things. The default all along has debugging enabled (As well as the selection made using wx-config), but the executable code claims to have debugging disabled.
wxTNewb
Knows some wx things
Knows some wx things
Posts: 28
Joined: Tue Sep 04, 2007 3:57 pm

Post by wxTNewb »

Found the solution using info from

http://ubuntuforums.org/showthread.php?t=167747

Needed to completely remove the libraries and reinstall them.. Not sure why, but there it is.