Building Audacity on Visual Studio 2015

From Audacity Wiki
Revision as of 16:13, 17 April 2016 by Rachalmers (talk | contribs)
Jump to: navigation, search
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 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

  1. libnyquist
  2. libsndfile
  3. lv2

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

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. 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 ...

[1] 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

[2] 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.