Building Audacity on Visual Studio 2015
|Audacity is currently built with Visual Studio 2013 as outlined on Developing On Windows. This page is about experiments getting Audacity to build on VS 2015.
- Others may like to know that to solve the snprintf problem you can right-click over "Audacity" in Solution Explorer > Properties. Then expand "Configuration Properties" and click "General". Set "Platform Toolset" to "Visual Studio 2013 (v120)".
- Or, apply the changes in the commit "Switch to VS2015 (v140)" at https://github.com/henricj/audacity/commit/dd029b2. Henricj's fork is known working as of 17 April 2016 to build Audacity using Visual Studio 2015.
On this and other pages, I (User:Rachalmers) will be detailing just what I am doing to try and get Audacity to compile cleanly and successfully on Windows 10 using Visual Studio 2015 and its related SDKs.
You should also note, if you intend following this path, that I have the latest version of wxWidgets wxWidgets-3.0.1 compiled as well using Visualstudio 2015 - using the GUI/IDE. Not the command line. It pretty much compiles straight out of the box.
However, as at Friday 15th April, 2016, I have the compile down to 21 out of 24 parts building successfully for Audacity. I am also aware of the ability to use an earlier toolset - 2013 - but hey! that's not the point of this exercise. This exercise is to try and bring the whole process up to speed with the latest VS, and run it in either x32 or x64.
Those Solutions not building in my first git pull are
Their problems are in the main, these types of problems.
- 22>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
- 22>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): note: command-line arguments: see previous definition of 'snprintf'
- 22>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration
I have applied this,
#if _MSC_VER < 1900 #define snprintf _snprintf #endif
to everywhere I can find a #define - and it made some little difference.... but the error persists. At the moment, I can't find the culprits.
So as of today, Friday 14th. I have 655 Errors, 558 Warnings. Meaning 21 successful and 3 not.
Note please. NB: Sunday 17th April 2016
I am doing this in two places - a masochist at heart - in that I have a git clone of the standard normally available to everyone from the front developers pages.
This is the one I talk about first. The one done so far.
The second one I talk about is one done by one of the developers. 'Henricj'. and available here. https://github.com/henricj/audacity Note that's henri CJ <-
You can begin to see the detail on this Permalink to the post in the forum when Henricj comes up with the goods. Thanks. I love this man ...
-  Permalink to forum post by henricj
This compiles with no errors as it comes. If you alter it - it will break :-) However, there are still 607 errors showing for the debug/Win32 build version
 Screenshot of successful build of the Henrcj work.
Now in order to understand what is happening and how to make it happen, I will go through my first git pull, and apply henricj's patches and see what happens. It's the perfect way of completely understanding what is going on.
And regardless, on both, I'm also working my way through the mass of warnings being reported. Some of which are proving difficult to fix. If people want to share in the excitement (sic) then I may yet also pop my first work-in-progress up to github in my own repository.
Monday 18th April. 2016 To build a successful build on VS2015, at the moment you will need Henrycj's git repository. You will also need the wxWidgets-3.1.0 repository. Build wxWidgets first, just building either the x32, or x64 DLL builds. Which ever you wish. You will need those DLLs to be able to run your Audacity. Build Audacity from \win on VS2015, building either the Debug or Release versions - to match your wxWidgets DLL versions. and either x32 or x64 versions. Which ever your preference. Not many machines these days are still x32. Certainly production machines. In other words, if you are a serious Audiophile - using Audacity, you will almost certainly have an x64 bit machine. You will almost certainly have either Windows 10, or OSX 10.11 (El Capitan) as well. I know lots of people run Linux etc etc , but frankly, I've yet to see such a beast in a production studio. I could be wrong.