[xwGtk] What is the official command line to configure xwWidgets for compilation?

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
tomay3000
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Mon Apr 24, 2017 4:23 am

[xwGtk] What is the official command line to configure xwWidgets for compilation?

Post by tomay3000 »

Hello,
I have installed the Codelite's wxWidgets version, and I have got mismatch ABI version with my compiled CodeBlocks version. So I have to download and compile wxWidgets myself.

Could anyone pass me the official ./configure command line for both gtk2 and gtk3.

Also, how to install the source code for debugging.

Thank you for your understanding.
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: [xwGtk] What is the official command line to configure xwWidgets for compilation?

Post by DavidHart »

Hi,
got mismatch ABI version with my compiled CodeBlocks version. So I have to download and compile wxWidgets myself
Why? Of course different wx versions will have different ABI versions, but that will only cause a problem if you are trying to link e.g. 2 .o files that were built against different wx installs. So maybe all you need to do is to 'make clean' your program...

You might also have a mismatch between your CodeBlock's compiler and linker settings. Make sure they are both pointing to the same wxWidgets install.

If you do want/need to build your own wx, there is no 'official' configure line; you can build it however you like. However I strongly suggest that you do not 'install' it. Instead keep it 'local' and point to its wx-config. That way there is no chance of conflict between wx versions.

I suggest you build in a subdir of the wx source dir, so start with e.g.
mkdir buildgtk2 && cd buildgtk2
Then a basic configure line would be:
../configure --prefix=$(pwd)
followed by:
make -j
You do not need to 'make install'.

For gtk+3:
mkdir buildgtk3 && cd buildgtk3
../configure --with-gtk=3 --prefix=$(pwd) && make -j

In both your CodeBlocks compiler and linker settings you will call the wx version of your choice by using the full path to that wx-config. I do not know the correct syntax for CodeBlocks, but CodeLite would use:
$(shell /full/path/to/builtgtk2 --cxxflags)
and
$(shell /full/path/to/builtgtk2 --libs)
for the gtk+2 build.

For full information see your wxWidgets source's docs/gtk/install.txt file.
Also, how to install the source code for debugging.
Since wx3.0 all Linux builds are debug builds, so you do not need to do anything special.

Regards,

David
tomay3000
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Mon Apr 24, 2017 4:23 am

Re: [xwGtk] What is the official command line to configure xwWidgets for compilation?

Post by tomay3000 »

when I try to start codeblocks from the command line:

Code: Select all

Fatal Error: Mismatch between the program and library build versions detected.
The library used 3.1.1 (wchar_t,compiler with C++ ABI 1002,wx containers,compatible with 3.0),
and your program used 3.1.1 (wchar_t,compiler with C++ ABI 1011,wx containers,compatible with 3.0).
Aborted (core dumped)
This is my gcc version:

Code: Select all

gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: [xwGtk] What is the official command line to configure xwWidgets for compilation?

Post by DavidHart »

when I try to start codeblocks from the command line:
Oh, you mean CodeBlocks itself. I thought you meant if you tried to build a program inside CodeBlocks.

When you installed wxWidgets from the CodeLite site, did you uninstall your distro's official wxWidgets libs? If so, that might explain the problem. You should be able to have both installed at the same time. To avoid conflicts, install the distro's libwx* but not libwx*-dev.
tomay3000
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Mon Apr 24, 2017 4:23 am

Re: [xwGtk] What is the official command line to configure xwWidgets for compilation?

Post by tomay3000 »

Sure I meant CodeBlocks itself.
It is a fresh new installation of Linux Mint 19 x64 (No previous official wxWidgets libs were installed).

I will delete all libwx*-dev and see.
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: [xwGtk] What is the official command line to configure xwWidgets for compilation?

Post by DavidHart »

I will delete all libwx*-dev and see.
No! You will need the correct libwx*-dev for building.

Just make sure the official wxWidgets lib packages are there.
(No previous official wxWidgets libs were installed)
They must have been, or CodeBlocks would never have worked. They were probably installed as dependencies.
tomay3000
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Mon Apr 24, 2017 4:23 am

Re: [xwGtk] What is the official command line to configure xwWidgets for compilation?

Post by tomay3000 »

Sorry the same problem persists.
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: [xwGtk] What is the official command line to configure xwWidgets for compilation?

Post by DavidHart »

That's surprising. Perhaps more information would help.

Where did your CodeBlocks come from? Did it used to work on your Mint 19? (If not, your problem is probably nothing to do with wx3.1.1)

What is the output of doing, in a terminal:
ldd /full/path/to/codeblocks | grep wx

Try uninstalling wx3.1.1. Does CodeBlocks now run? What is the ldd output now?

If you can think of any other relevant information, it would save us both a lot of time...
tomay3000
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Mon Apr 24, 2017 4:23 am

Re: [xwGtk] What is the official command line to configure xwWidgets for compilation?

Post by tomay3000 »

DavidHart wrote:That's surprising. Perhaps more information would help.

Where did your CodeBlocks come from? Did it used to work on your Mint 19? (If not, your problem is probably nothing to do with wx3.1.1)

What is the output of doing, in a terminal:
ldd /full/path/to/codeblocks | grep wx

Try uninstalling wx3.1.1. Does CodeBlocks now run? What is the ldd output now?

If you can think of any other relevant information, it would save us both a lot of time...
Hello,
I have finally managed to compile C::B under linux mint 19 x64.
The problem was in the Codelite's wxWidgets v3.1.1 binaries (indeed it was compiled with a gcc version which has a C++ ABI v1002 that is not compatible with C++ ABI v1011 of my compiler).

I had to compile wxWidgets myself so that C::B can link to it without any problems.

Thank you.
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: [xwGtk] What is the official command line to configure xwWidgets for compilation?

Post by DavidHart »

I'm glad you have it working, but I'm surprised you had a problem.
The problem was in the Codelite's wxWidgets v3.1.1 binaries (indeed it was compiled with a gcc version which has a C++ ABI v1002 that is not compatible with C++ ABI v1011 of my compiler).
Which of the wxWidgets 3.1.1 binaries did you download? The one for ubuntu bionic was build with gcc 7.3.0, the same gcc version as your Mint 19. (ubuntu artful has 7.2.0)
Last edited by DavidHart on Thu Jul 19, 2018 6:29 pm, edited 1 time in total.
Reason: Corrected ubuntu version
tomay3000
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Mon Apr 24, 2017 4:23 am

Re: [xwGtk] What is the official command line to configure xwWidgets for compilation?

Post by tomay3000 »

Which of the wxWidgets 3.1.1 binaries did you download? The one for ubuntu bionic was build with gcc 7.3.0, the same gcc version as your Mint 19. (ubuntu bionic has 7.2.0)
using this command line:

Code: Select all

sudo apt-key adv --fetch-keys http://repos.codelite.org/CodeLite.asc

sudo apt-add-repository 'deb http://repos.codelite.org/wx3.0/ubuntu/ xenial universe'
sudo apt-add-repository 'deb http://repos.codelite.org/wx3.1/ubuntu/ xenial universe'

sudo apt-get update

sudo apt-get install \
libwxbase3.1-0-unofficial \
libwxbase3.1-dev \
libwxgtk3.1-0-unofficial \
libwxgtk3.1-dev \
wx3.1-headers \
wx-common \
libwxgtk-media3.1-0-unofficial \
libwxgtk-media3.1-dev \
libwxgtk-webview3.1-0-unofficial \
libwxgtk-webview3.1-dev \
libwxbase3.1-0-unofficial-dbg \
libwxgtk3.1-0-unofficial-dbg \
libwxgtk-webview3.1-0-unofficial-dbg \
libwxgtk-media3.1-0-unofficial-dbg \
wx3.1-i18n \
wx3.1-examples
here are my g++ version details:

Code: Select all

g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-16ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --with-as=/usr/bin/x86_64-linux-gnu-as --with-ld=/usr/bin/x86_64-linux-gnu-ld --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: [xwGtk] What is the official command line to configure xwWidgets for compilation?

Post by DavidHart »

sudo apt-add-repository 'deb http://repos.codelite.org/wx3.0/ubuntu/ xenial universe'
That explains your problem. You downloaded the version intended for ubuntu 16.04 (xenial) and Mint 18.
I think you would have found that:

Code: Select all

deb http://repos.codelite.org/wx3.0/ubuntu/ bionic universe
would have worked normally for you as Mint 19 is based on ubuntu 18.04 (bionic).
tomay3000
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Mon Apr 24, 2017 4:23 am

Re: [xwGtk] What is the official command line to configure xwWidgets for compilation?

Post by tomay3000 »

Yes I completely forgot that I have made an OS upgrade.

and I have previously saved that wx installation command line into a text file. And I just used it directly without paying attention.

You can call me a dumb or whatever. I just have had enough.
Post Reply