Audacity crashes with multiple versions of gtk installed


audacity-2.4.2 on FreeBSD 12.2-RELEASE.
I have tested both binary package and I have compiled from ports.
In all cases, it core dumps on launch with

(Audacity:73546): Gtk-ERROR **: 20:53:42.191: GTK+ 2.x symbols detected. Using GTK + 2.x and GTK+ 3 in the same process is not supported
zsh: trace trap (core dumped)

If I move out of my lib path, it launches and runs. ldd of audacity shows that it is linked with libgtk-3, so it is apparently attempting to also link with libgtk-2 at run time. This is true even if I remove out of the library path prior to compiling audacity.

This problem has only recently appeared after upgrading to FreeBSD 12.x. I have run audacity for the last several years on FreeBSD without problem. I know it has been broken at least since FreeBSD-12.1 in which the port version of audacity was 2.3.2. Not sure if it worked on FreeBSD 12.0 or not. I know the port version of audicaty was 2.3.1 in FreeBSD-11.3, so so far as I know it was working fine until at least that version.

About half the applications on my system are using gtk2 and the other half are using gtk3. So both version must remain install. I am not having any such problem with any other application that I know of.

Any help would be appreciated on getting it working again. Audacity is the only audio editor I know of that can do noise reduction on an audio recording.


According to the developer notes on the Audacity wiki:


Audacity’s fork of wxWidgets 3.1.3 (>> ) should
be used as this includes bug fixes that are not yet available upstream.
WxWidgets should be built with gtk2 as gtk3 is not yet fully supported.

Thanks for the reply Steve.

Next attempt:

I installed package wx28-gtk2-2.8.12 (wxWidgets) from FreeBSD ports.

Edited the port Makefile:
-USE_WX= 3.1+
+USE_WX= 2.8+

“make configure”, at the top of the port tree, now genetates


Previously it contained

//Location of wxWidgets library configuration provider binary (wx-config).

The output of “make configure” also now indicates it is
going to use libgtk-x11-2.0.

However, now it does not build at all. It outputs all kinds of errors.

Just to list a few of the errors:

/data/freebsd/ports/ports-12.2/audio/audacity/work/audacity-Audacity-2.4.2/src/MemoryX.h:685:7: error: use of undeclared identifier 'swap'
      swap( other );
/data/freebsd/ports/ports-12.2/audio/audacity/work/audacity-Audacity-2.4.2/src/MemoryX.h:692:10: error: use of undeclared identifier 'swap'
         swap( other );
In file included from /data/freebsd/ports/ports-12.2/audio/audacity/work/audacity-Audacity-2.4.2/src/AudacityException.cpp:23:
In file included from /data/freebsd/ports/ports-12.2/audio/audacity/work/audacity-Audacity-2.4.2/src/AudacityException.h:23:
In file included from /data/freebsd/ports/ports-12.2/audio/audacity/work/audacity-Audacity-2.4.2/src/Internat.h:20:
/data/freebsd/ports/ports-12.2/audio/audacity/work/audacity-Audacity-2.4.2/include/audacity/Types.h:60:28: error: no member named 'ToStdWstring' in 'wxString'
         auto stdstr = str.ToStdWstring(); // no allocations, a cheap fetch
                       ~~~ ^
/data/freebsd/ports/ports-12.2/audio/audacity/work/audacity-Audacity-2.4.2/include/audacity/Types.h:62:17: error: use of undeclared identifier 'Hasher'
         return Hasher{}( stdstr );
/data/freebsd/ports/ports-12.2/audio/audacity/work/audacity-Audacity-2.4.2/include/audacity/Types.h:92:34: error: no matching constructor for initialization of 'wxString'
   Identifier(const char *str) : value{ str } {}
                                 ^    ~~~~~~~