moving to wxWidgets 3.0

Make sure to reboot your computer after resetting the WXWIN environmental variable! Do this before you attempt to ever compile Audacity.

Use this Microsoft Visual Studio project:
audacity-vs2012.sln
to compile Audacity.

I would suggest following this procedure:

  1. download & compile current wxWidgets stable 3.0

  2. set WXWIN environmental variable

  3. Make sure to reboot your computer after resetting the WXWIN environmental variable! Do this before you attempt to ever compile Audacity.

  4. checkout a clean Audacity SVN HEAD

  5. open the audacity-vs2012.sln in VC++ 2012 and make all the needed Linker library changes:
    Use a text editor which will edit these two files:
    winProjectsAudacityAudacity.vcproj
    [previous line edited 21 November 2013 to repair typo]
    winProjectsAudacityAudacity.vcxproj
    use search and replace (case-sensitive NOT full word) to change all instances of:
    wxbase28
    into:
    wxbase30
    (should be four replacements) and also:
    wxmsw28
    into:
    wxmsw30
    (should be six replacements).

  6. while not mandatory, if you plan on making your own changes to the source code, you might want to add the wxWidgets include/lib paths:
    $(WXWIN)includelib
    to your Visual Studio’s search paths (under Tools>Options>Projects>VC++ Directories.

  7. search all Audacity source code for every instance of “AddPendingEvent” it will find a bunch of lines like:
    AddPendingEvent(e);
    change them to:
    ProcessWindowEvent(e);
    (remember the (e) might really be (event) then use “ProcessWindowEvent(event);” etc. (Note - the word “event” is a reserved word for Microsoft’s Visual Studio so in the future it should not be used and eventually all existing usages must be replaced.)

  8. There are lots of wxFont related statements which will need to be changed:
    wxFont(fontSize, wxSWISS, wxNORMAL, wxNORMAL)
    will become:
    wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL)
    in this case you’ll want to search (match case, match whole word):
    wxSWISS, wxNORMAL, wxNORMAL
    and replace with:
    wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL

wxFont(fontSize, wxSWISS, wxNORMAL, wxBOLD)
will become:
wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD)
in this case you’ll want to search (match case, match whole word):
wxSWISS, wxNORMAL, wxBOLD
and replace with:
wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD

wxFont(fontSize, wxFIXED, wxNORMAL, wxNORMAL)
will become:
wxFont(fontSize, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL)
in this case you’ll want to search (match case, match whole word):
wxFIXED, wxNORMAL, wxNORMAL
and replace with:
wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL

NOTE in wxWidgets 2.8 style and weight use the same #define (wxNORMAL) so you cannot simply replace it globally.

There will be a few places that this misses, the next thing you’ll want to do is search for these:
wxSwiss becomes wxFONTFAMILY_SWISS
wxFixed becomes wxFONTFAMILY_TELETYPE
wxModern becomes wxFONTFAMILY_MODERN
wxNormal becomes one of: wxFONTSTYLE_NORMAL or wxFONTWEIGHT_NORMAL (be careful not to get them mixed up)
wxBold becomes wxFONTWEIGHT_BOLD


9) use Batch Build to compile everything (click the “Select All” button Then the “Build” button – this will build the entire Audacity solution including help and locale plus all the external libraries in both Release and Debug configurations). You will get a lot of errors!

  1. I found it easiest to start with the external libraries–fewer changes–so open the Solution Explorer window and start at the bottom “twolame”–right-click to get a context menu, choose Project Only > Build only twolame, fix errors until it builds then move up to “soundtouch” and continue.

When you hit an error search through the above patch to find the solution (or a similar solution) and apply the fix manually.

I have attached a new patch against revision 12947 SVN HEAD as of 14 November 2013. I have not tested the functionality of this version of Audacity but I know there are problems – the Log is broken, trying to access it from the menu causes Audacity to crash.
2wx30-2.zip (233 KB)