Build issues, v2.1.2, in OS X 10.11 with Xcode 7.3

Hi everyone, I just started messing around with Audacity (mostly to mess around with the signal processing toolboxes – that’s not the topic of this thread, but I did want to mention how excited I am about this). I’m running into a few issues as I build on my mactop and figured I’d at least document some of the issues I run into as I go. I should mention that I’m extremely new to Xcode and still fairly new to software development in general.

Some general info: I’m building Audacity 2.1.2, on El Capitan (OS X 10.11) with Xcode 7.3. I’m using Apple’s compiler, which is the only choice these days.

1. Install wxWidgets: DONE. I did this from the command line using their configure script; make; make install. The flags I used to configure were straight off the wxWidgets wiki and the whole thing took about 20 minutes to compile on my 2013 MacBook Pro (2.9 GHz i7, 8GB RAM). For posterity here are the flags I used:

OS_X_FLAGS="--with-osx_cocoa --with-macosx-version-min=$OS_X_VER --with-macosx-sdk=/Applications/$OS_X_VER.sdk"

../configure $OS_X_FLAGS  --prefix=$INSTALL_DIR

I notice that brew doctor now complains because the binary wx-configure lives outside the Homebrew directory. I’m not too worried about this.

2. Clone Audacity source and navigate to${AUDACITY_SRC_HOME}/mac. Though it seems to be supported, I was unsure how to build all the libraries automatically from the command line. Many of the dependencies are availabe thru Homebrew, but Xcode does all of them for you. That is, if can coax/coerce Xcode to building for you…

3. Open Audacity.xcodeproj in Xcode and configure the build settings. Make some progress and then get stuck and write about it on forum.

This is where the trail gets cold. Here’s a list of the errors I encountered until I got stuck on the last one.

  • Naive first attempt
    • Error message: “The run destination My Mac is not valid for Running the scheme ‘Debug’.”
    • Diagnosis: This is a clean install and I don’t have the legacy OS X 10.6 SDK.
    • Action(s): I changed this setting to 10.11 in Audacity Project > Build Settings > Architectures > Base SDK
  • WX configure
    • Error Message: “wx/event.h” not found
    • Diagnosis: Seems pretty clear what’s going on here. I didn’t install wxWidgets in the default location
    • Action(s): I go to Build Settings > User-Defined and change WX_PREFIX to where it is installed locally ($INSTALL_DIR in configure script quoted above). Also, there are a few other user-defined variables that need to be configured. I am using wx version 3.1, and I didn’t build both a debug a release version, so I had to modify some of the values (all in all, I modified WX_PREFIX and WX_VER, deleted WX_FLAVOR, and manually edited WX_CFLAGS and WX_LDFLAGS. Other variables changed that were linked to these values).
  • Problem with lib-src/FileDialog/mac/
    • Error Message (multiple): “Expected ‘;’ after top level declarator”, “C++ requires a type specifier for all declarations”, “Cannot declare a variable inside @interface or @protocol”, “Use of undeclared identifier”, etc. etc. , all on the first line after the include statements.
    • Diagnosis: The compiler isn’t picking up on the fact that this is Objective-C code.
    • Action: Try switching stdlib to different dialect to no avail.

So, that’s where I’m at on that… I’d love to get this compiled from source so I can start adding my own weird effects and such, so please do let me know if any of you have wisdom or insight here! Thanks errybody

Have you read the other posts on the Forum about using Xcode greater than 7.1? Start from here and read down

Audacity does not support wxWidgets 3.1, only 3.0.2. So you are on your own if you want to use later wxWidgets. It pays to read the files about building in the Audacity source code. :wink:

Homebrew could be another complication. If you have been forced to use Homebrew for some other work you are doing, you may have to do “brew install wxmac --universal” then use xcodebuild to build Audacity. At least, that is what someone said. Again, Audacity has no official support for homebrew.