Cannot compile with wxMediaCtrl - linker errors

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
davidlondonuk
In need of some credit
In need of some credit
Posts: 8
Joined: Mon May 21, 2018 6:58 am

Cannot compile with wxMediaCtrl - linker errors

Post by davidlondonuk »

Hi All,

I am using Xubuntu 18.04 and have been able to compile wxwidgets apps without problems until I tried to use wxMediaCtrl.

I have the following ubuntu wx packages installed:
libwxgtk-media3.0-gtk3-0v5:amd64
libwxgtk3.0-0v5:amd64
libwxgtk3.0-dev
libwxgtk3.0-gtk3-0v5:amd64

wx-config --list gives the following output:
Default config is gtk2-unicode-3.0
Default config will be used for output
Alternate matches:
base-unicode-3.0

wx-config --help shows:
Available libraries in this build are:
xrc stc richtext ribbon propgrid aui gl media html qa adv core xml net base

I have tried changing the makefile to use `wx-config --libs core,media` but linking always fails with
cannot find -lwx_gtk2u_media-3.0 - I even tried linking with the ubuntu gtk3-media package but compile failed.

How do I correct this problem? I don't mind compiling wxwidgets from source but what configure options would I need to use gtk3 and have the present range of options that I have now?

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

Re: Cannot compile with wxMediaCtrl - linker errors

Post by DavidHart »

Hi,
I have tried changing the makefile to use wx-config --libs core,media
That should be wx-config --libs std,media
or alternatively wx-config --libs all

If those still fail to link, what is the output of doing, in a terminal:
wx-config --libs all

Regards,

David
davidlondonuk
In need of some credit
In need of some credit
Posts: 8
Joined: Mon May 21, 2018 6:58 am

Re: Cannot compile with wxMediaCtrl - linker errors

Post by davidlondonuk »

Thanks David,

wx-config libs all :

-L/usr/lib/x86_64-linux-gnu -pthread -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_stc-3.0 -lwx_gtk2u_richtext-3.0 -lwx_gtk2u_ribbon-3.0 -lwx_gtk2u_propgrid-3.0 -lwx_gtk2u_aui-3.0 -lwx_gtk2u_gl-3.0 -lwx_gtk2u_media-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0

It looks like the ubuntu libs are compiled against gtk2, not sure why they have the media package if it won't work?

Any ideas? Do I need to compile wxwidgets with gtk3? If so, is there a guide for the best configure options?
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Cannot compile with wxMediaCtrl - linker errors

Post by DavidHart »

wx-config libs all: ... -lwx_gtk2u_media-3.0
Did you try putting wx-config libs all in your makefile? Did that still fail? If so, what happens if you try to build your app from the commandline, using something like:
g++ *.cpp $(wx-config --cxxflags --libs all) -o appname
Do I need to compile wxwidgets with gtk3
No, not unless you particularly want a gtk3 build. Or does your makefile need a wx gtk3 for some reason? (If so, fix it. ;) )
If so, is there a guide for the best configure options?

Code: Select all

mkdir builddir && cd builddir && ../configure --with-gtk=3 --enable-mediactrl --prefix=$(pwd) && make -j
will get you an 'in-situ' gtk3 build inside builddir/ that won't conflict with your current install. You should check the configure output for mediactrl missing dependencies, though (you may need some of libgtk-3-dev, libsm-dev, libgl1-mesa-dev | libgl-dev, libglu1-mesa-dev | libglu-dev, libesd0-dev, libxt-dev, libgstreamer-plugins-base1.0-dev, libgconf2-dev). You'd access that build in a makefile by using /full/path/to/builddir/wx-config or prepending /full/path/to/builddir/ to your terminal's PATH.
davidlondonuk
In need of some credit
In need of some credit
Posts: 8
Joined: Mon May 21, 2018 6:58 am

Re: Cannot compile with wxMediaCtrl - linker errors [SOLVED]

Post by davidlondonuk »

Hi,

The linking problem was due to a missing package (top one below), that provided libwx_gtk2u_media-3.0:
libwxgtk-media3.0-0v5:amd64 (gtk2)
libwxgtk-media3.0-gtk3-0v5:amd64 (gtk3)

However, that package had a missing symlink (libwx_gtk2u_media-3.0.so) which I created manually - after that and using wx-config --libs std,media the program compiled without problems.

Thanks for your help.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Cannot compile with wxMediaCtrl - linker errors

Post by ONEEYEMAN »

Hi,
You should post to the Ubuntu forum or send an E-mail to their ML complaining about this (missing symlink).

Because if you software will be distributed to the customers they will start complaining to you. ;-)

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

Re: Cannot compile with wxMediaCtrl - linker errors

Post by DavidHart »

You should post to the Ubuntu forum or send an E-mail to their ML complaining about this (missing symlink).
I think you'll find it was missing only because libwxgtk-media3.0-dev was not installed; something I should have noticed from the first post :( .
Post Reply