Update Build Instructions for Windows, perhaps?

Building and customizing Audacity from the source code.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
jademan
Forum Crew
Posts: 1499
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Windows 10

Re: Update Build Instructions for Windows, perhaps?

Post by jademan » Wed Mar 03, 2021 9:35 pm

rafadess wrote:
Wed Mar 03, 2021 5:55 pm
How about I writing here what I have in mind and then, if you agree, you can incorporate to your PR? It might be simpler, I don't know. Again, this is my first time trying to contribute to an open source program...
Thanks. I am glad you got this working. Your comments will be helpful to other current and future contributors.

And I am sure James will read them, as well. :D

pr98038
Posts: 2
Joined: Wed Mar 03, 2021 6:07 pm
Operating System: Windows 10

Re: Update Build Instructions for Windows, perhaps?

Post by pr98038 » Sat Mar 06, 2021 4:57 pm

Odd. The instructions worked worked for my installation of Visual Studio 2019 version 16.3.8. Using the same instructions starting with a new Virtualbox Windows 10 installation with the latest Visual Studio 2019 version 16.9.0 did not work with 68 errors. I am a novice Visual Studio user. Not sure what went wrong.

Code: Select all

Severity	Code	Description	Project	File	Line	Suppression State
Error	C3536	'playbackBufferSize': cannot be used before it is initialized 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\AudioIO.cpp	1914	
Error	C2672	'std::min': no matching overloaded function found 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\AudioIO.cpp	1914	
Error	C2780	'_Ty std::min(std::initializer_list<_Elem>)': expects 1 arguments - 2 provided 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\AudioIO.cpp	1914	
Error	C2784	'_Ty std::min(std::initializer_list<_Elem>,_Pr)': could not deduce template argument for 'std::initializer_list<_Elem>' from 'size_t' 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\AudioIO.cpp	1914	
Error	C2782	'const _Ty &std::min(const _Ty &,const _Ty &) noexcept(<expr>)': template parameter '_Ty' is ambiguous 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\AudioIO.cpp	1914	
Error	C2784	'const _Ty &std::min(const _Ty &,const _Ty &) noexcept(<expr>)': could not deduce template argument for 'const _Ty &' from 'int' 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\AudioIO.cpp	1914	
Error	C2780	'const _Ty &std::min(const _Ty &,const _Ty &,_Pr) noexcept(<expr>)': expects 3 arguments - 2 provided 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\AudioIO.cpp	1914	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\AudioIO.cpp	2006	
Error	C3536	'playbackBufferSize': cannot be used before it is initialized 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\AudioIO.cpp	2007	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\AudioIO.cpp	3006	
Error	C2169	'lrint': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\Dither.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	61	
Error	C2169	'lrintf': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\Dither.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	73	
Error	C2065	'lrintf': undeclared identifier 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\Dither.cpp	332	
Error	C2568	'=': unable to resolve function overload 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\Dither.cpp	332	
Error	C2065	'lrintf': undeclared identifier 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\Dither.cpp	335	
Error	C2568	'=': unable to resolve function overload 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\Dither.cpp	335	
Error	C2065	'lrintf': undeclared identifier 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\Dither.cpp	339	
Error	C2568	'=': unable to resolve function overload 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\Dither.cpp	339	
Error	C2065	'lrintf': undeclared identifier 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\Dither.cpp	343	
Error	C2568	'=': unable to resolve function overload 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\Dither.cpp	343	
Error	C2065	'lrintf': undeclared identifier 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\Dither.cpp	395	
Error	C2568	'-': unable to resolve function overload 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\Dither.cpp	395	
Error	C2169	'lrint': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\Mix.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	61	
Error	C2169	'lrintf': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\Mix.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	73	
Error	C2169	'lrint': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\TrackPanel.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	61	
Error	C2169	'lrintf': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\TrackPanel.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	73	
Error	C2169	'lrint': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\WaveTrack.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	61	
Error	C2169	'lrintf': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\WaveTrack.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	73	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\WaveTrack.cpp	1634	
Error	C2169	'lrint': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\effects\Compressor.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	61	
Error	C2169	'lrintf': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\effects\Compressor.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	73	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\effects\Compressor.cpp	364	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\effects\Compressor.cpp	365	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\effects\Compressor.cpp	366	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\effects\Compressor.cpp	367	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\effects\Compressor.cpp	368	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\effects\Compressor.cpp	771	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\effects\Compressor.cpp	772	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\effects\Compressor.cpp	775	
Error	C2169	'lrint': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\effects\Equalization.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	61	
Error	C2169	'lrintf': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\effects\Equalization.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	73	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\effects\Equalization.cpp	2473	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\effects\Equalization.cpp	3194	
Error	C2169	'lrint': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\export\ExportCL.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	61	
Error	C2169	'lrintf': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\export\ExportCL.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	73	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\export\ExportCL.cpp	399	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\export\ExportCL.cpp	401	
Error	C2169	'lrint': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\export\ExportMP3.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	61	
Error	C2169	'lrintf': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\export\ExportMP3.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	73	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\export\ExportMP3.cpp	1752	
Error	C2169	'lrint': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\export\ExportFLAC.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	61	
Error	C2169	'lrintf': intrinsic function, cannot be defined (compiling source file C:\audacity300\audacity\src\export\ExportFLAC.cpp) 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\float_cast.h	73	
Error	C2264	'lrint': error in function definition or declaration; function not called 	C:\audacity300\audacity\out\build\x86-Release\audacity	C:\audacity300\audacity\src\export\ExportFLAC.cpp	278
Last edited by steve on Sat Mar 06, 2021 5:04 pm, edited 1 time in total.
Reason: code tags added

jademan
Forum Crew
Posts: 1499
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Windows 10

Re: Update Build Instructions for Windows, perhaps?

Post by jademan » Sat Mar 06, 2021 8:01 pm

pr98038 wrote:
Sat Mar 06, 2021 4:57 pm
Odd. The instructions worked worked for my installation of Visual Studio 2019 version 16.3.8. Using the same instructions starting with a new Virtualbox Windows 10 installation with the latest Visual Studio 2019 version 16.9.0 did not work with 68 errors. I am a novice Visual Studio user. Not sure what went wrong.
I get 68/69 errors too with the latest update.

The hazards and rewards of updating your Microsoft software. ;)

I'll take a look at this and see what I can find. Anyone else ?

jademan
Forum Crew
Posts: 1499
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Windows 10

Re: Update Build Instructions for Windows, perhaps?

Post by jademan » Sat Mar 06, 2021 8:35 pm

OK, it appears that Visual Studio 2019 version 16.9.0 is now supplying intrinsic implementations for the lrint and lrintf instructions. Since VS2019 wasn't before, Audacity was supplying it's own version. Microsoft considers this a "fix" for a previous omission. Unfortunately, this "fix" breaks Audacity.

There is existing logic within the audacity code intended to ferret out which compilers have lrint and which ones do not, but this logic apparently needs to be adjusted.

A quick and dirty fix would be to comment out the code in float_cast where these are defined. A better solution would be to integrate into the existing inclusion logic.

Later...

jademan
Forum Crew
Posts: 1499
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Windows 10

Re: Update Build Instructions for Windows, perhaps?

Post by jademan » Sat Mar 06, 2021 11:03 pm

So I have a fix for the 16.9.0 version of VS2019:

Edit your local copy of c:\aud300\audacity\src\float_cast.h:

1) Add the following line immediately before the "__inline long int" line near line 59/60:

Code: Select all

#if 0
2) Add the following line immediate before the "__inline long long int" line near line 83:

Code: Select all

#endif
Let me know how this works.

I hope this helps. :D

pr98038
Posts: 2
Joined: Wed Mar 03, 2021 6:07 pm
Operating System: Windows 10

Re: Update Build Instructions for Windows, perhaps?

Post by pr98038 » Sun Mar 07, 2021 2:08 am

Thanks. I did something similar to comment that part of code out.
I also added ASIO support by copying the ASIO SDK a creating/setting the ASIOSDK_DIR environment variable to it.
I was trying to update to use newer ffmpeg import/export libraries (i.e. avformat-*.dll, avutil-*.dll, avcodec-*.dll) but wasn't successful. I read somewhere else that replacing the header files in ..\audacity\lib-src\ffmpeg with ones from a newer ffmpeg release would work. Doing so does make the prompt for the ffmpeg libraries use the newer dll filenames but they don't load.

adi_ganti
Posts: 6
Joined: Tue Mar 16, 2021 2:37 pm
Operating System: Windows 10

Re: Update Build Instructions for Windows, perhaps?

Post by adi_ganti » Wed Mar 17, 2021 12:49 pm

After 4 days, trying various sources, I have finally successfully built Audacity. As a first-timer, it was very frustrating. However, in the process, I learnt a little about GitHub Actions (idek how xD), CMake and MinGW.

I also got 68 errors, which I intuitively figured to comment out, so I'm glad I've learnt something. Thanks a lot to @jademan
Now, I just have to figure out what to do next :p

Apesbrain
Posts: 95
Joined: Sat Dec 04, 2010 4:58 pm
Operating System: Windows 10

Re: Update Build Instructions for Windows, perhaps?

Post by Apesbrain » Fri Mar 19, 2021 12:18 pm

jademan wrote:
Sat Mar 06, 2021 11:03 pm
So I have a fix for the 16.9.0 version of VS2019:

Edit your local copy of c:\aud300\audacity\src\float_cast.h:

1) Add the following line immediately before the "__inline long int" line near line 59/60:

Code: Select all

#if 0
2) Add the following line immediate before the "__inline long long int" line near line 83:

Code: Select all

#endif
Let me know how this works.

I hope this helps. :D
With these edits, Audacity 3 successfully builds on latest VS with "O Errors/17 Warnings". Thanks.

jademan
Forum Crew
Posts: 1499
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Windows 10

Re: Update Build Instructions for Windows, perhaps?

Post by jademan » Fri Mar 19, 2021 12:59 pm

Apesbrain wrote:
Fri Mar 19, 2021 12:18 pm
With these edits, Audacity 3 successfully builds on latest VS with "O Errors/17 Warnings". Thanks.
Thanks for the word. BTW, the current 3.0.1 alpha has a improved fix for this latest issue with Visual Studio 16.9. It may run a little faster.... :D

wpostma
Posts: 13
Joined: Fri Mar 19, 2021 11:23 pm
Operating System: Windows 10

Re: Update Build Instructions for Windows, perhaps?

Post by wpostma » Sat Mar 27, 2021 5:04 am

The build instructions work, can confirm. Just got this built here.

The person posting above my reply suggesting additional "building debug version instructions" seem good and I think that instructions to debug from Visual Studio would be good. I had suggested some in the other thread above this.



Reproduced here briefly:


Debugging Audacity

0. Make sure it built first and check the output directory contains the exe.
1. Select the Startup Item
(show image)
2. Debug >Start Debugging (F5)

Also perhaps helpful is this image showing that it seems you need to set the cmake debug/x64 and the visual studio debug/x64 profile separately or you won't get your build.

https://i.ibb.co/BnrTkqr/same-same-matchy-matchy.png

Post Reply