Compiling on Win10 problems.

First off, following directions here: https://wiki.audacityteam.org/wiki/Building_On_Windows

I’ve cloned both wxWidgets (from the Audacity git) and Audacity. I’m able to build the wxWidgets .dll’s just fine. But when I try to build Audacity, I get the following error.

29>C:\Users\bahnz\source\repos\wxWidgets\include\wx\string.h(24,10): error C1083: Cannot open include file: ‘wx/defs.h’: No such file or directory
29>Done building project “Audacity.vcxproj” – FAILED.
========== Build: 21 succeeded, 5 failed, 0 up-to-date, 3 skipped ==========

or

29>AudacityHeaders.cpp
29>C:\Users\bahnz\source\repos\wxWidgets\include\wx\string.h(24,10): error C1083: Cannot open include file: ‘wx/defs.h’: No such file or directory
29>Done building project “Audacity.vcxproj” – FAILED.


I’ve made sure to set $WXWIN to the wxWidgets path, and checked that “$(WXWIN)\include” is set in the include path. Those files exist, so I can’t understand why they aren’t being found.

Ok, I’m going to update this with some info to help others.

I tried setting these environment paths from a cmd.exe shell opened with admin, but they didn’t stick. I had to do it the old fashioned way of using the control panel and opening advanced settings, etc. I was under the impression I could set them in a shell, because the instructions say that.

My ultimate goal is I want to compile with ASIO, so I think I’ll have that figured out.

BUT - the instructions given are pretty poorly written, obviously by a dev who really didn’t want to document them. There are steps missing, maybe some assumptions. Certainly compiling a program isn’t something for utter newbies, but I’m a programmer on a hobby(ist) level and even I had troubles. There could certainly be some better instructions given here.

Feel free to post some.
If they are accurate and easy to follow, I’ll make the post a “sticky” so that it remains at the top of this forum board.

The instructions in the build.txt are indeed written by developers for developers.

The instructions in the Audacity wiki are intended to provide additional information, but due to changes in the build system, a lot of (now obsolete) information has been removed.

I noted in another forum thread that I also had problems getting the environmental variables to stick. Windows seems to be rather buggy in this respect. Once I got that to work, the instructions in “build.txt” worked for me (not the easiest instructions to follow, but they worked).

Feel free to suggest improvements to either the wiki article or the build.txt.

I still have a copy of the HTML that I wrote which gives (in excruciating detail) all the steps necessary for downloading, compiling and/or installing Visual Studio, wxWidgets, Audacity and ASIO. They are very much out of date (Visual Studio 2008, Audacity 2.0 etc.) but might be a worthwhile starting point. Many folks who had never compiled a program before were able to follow the instructions all the way to getting ASIO working. There’s probably a copy attached to a post somewhere here on forum.

If that’s what is written it is definitely wrong. Changes made in an open command shell are not preserved when the shell is closed and only apply to programs run from that shell.
I have just checked the latest windows 10 version and the quick way to get to the advance system settings is to right click the start button and select run, then type in
SystemPropertiesAdvanced
The environment variables button is on that page.

As of June 25th or so the Audacity build will default to looking for wxWidgets in the lib-src\wxWidgets directory. If the WXWIN environment variable exists, then that directory will still be used.

Another problem people might face is that Visual Studio 2017 Community Edition is no longer easy to find on Microsoft’s website; the Visual Studio page now only shows Visual Studio 2019. My suggestion for building Audacity is to do the following:

  1. Install Visual Studio with the “Desktop development with C++” workload enabled.
  2. Put wxWidgets in lib-src\wxWidgets (so that wxWidgets is in the same folder as the other Audacity libraries like lv2 and portsmf).
  3. Make sure WXWIN does NOT exist (or, points to the lib-src\wxWidgets directory)
  4. Start a Visual Studio command prompt (e.g., “x86 Native Tools Command Prompt for VS 2019”)
  5. Build wxWidgets: "msbuild /m /t:Build \build\msw\wx_vc15.sln “/p:Configuration=DLL Release;Platform=Win32;PlatformToolset=v142”
  6. Build Audacity: Either open audacity.sln with Visual Studio and build from inside the IDE or run “nuget restore win/audacity.sln” and “msbuild /m /t:Build win/audacity.sln /p:Configuration=Release;Platform=Win32;PlatformToolset=v142” on the command line

For building with VS2017, set the Platform Toolset to “v141” instead of “v142”. To build the debug version, replace “Configuration=DLL Release” with “Configuration=DLL Debug” and “Configuration=Release” with “Configuration=Debug”.

Hello
I am building the audacity and wxwidget as per the above @henric 's instructions on VSC2017 in Windows 10:
My Audacity ‘Build Succeeded’ with 3 warnings and 0 errors.
When I try to run the “win\Release\Audacity.exe” by double clicking on it, I get these dll errors


  • 1.The code execution cannot proceed because > wxmsw311u_core_vc_cutom.dll > was not found. Reinstalling the program may fix this problem.

  • 2.The code execution cannot proceed because > wxbase311u_vc_cutom.dll > was not found. Reinstalling the program may fix this problem.

  • 3.The code execution cannot proceed because > wxmsw311u_qa_vc_cutom.dll > was not found. Reinstalling the program may fix this problem.

  • 4.The code execution cannot proceed because > wxmsw311u_adv_vc_cutom.dll > was not found. Reinstalling the program may fix this problem.

Where would I download those *.dll files from? Appreciated if anyone can help providing a link or instructions.

Thank you

Jai B.

You will already have them on your computer. Search for them, then copy them into the same directory as audacity.exe.

There are a few more you may need as per the old compile.txt instructions where * is replaced by u :-

. The DLLs required 
are at "C:\wxWidgets-3.1.1\lib\vc_dll":

	wxbase311*_net_vc_custom.dll
	wxbase311*_vc_custom.dll
	wxmsw311*_adv_vc_custom.dll
	wxmsw311*_core_vc_custom.dll
	wxmsw311*_html_vc_custom.dll
        wxbase311*_xml_vc_custom.dll
        wxmsw311*_qa_vc_custom.dll