[Solved] Trouble compiling Audacity from SVN with ASIO

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
Edgar
Forum Crew
Posts: 2043
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: Having alot of trouble compiling Audacity from SVN

Post by Edgar » Sun Feb 27, 2011 10:55 pm

From what I can tell, XP does not have a built-in GUI-based disk imaging program (you might find dd on your install disk and might be able to work with that but...) looking at the link Steve offers I see some reasonable choices. Having no experience with any of them I am not qualified to make a recommendation. Unfortunately, the process of trying one out is fraught with danger--I doubt that creating an image would cause problems but restoring the image (if defective) could be fatal.

If you have time and a spare hard drive I would partition it 60%/40% (XP/backup), install XP (no need to activate), make a bunch of changes to the look & feel--install some software to C: (obviously the imaging softwares you are to test), create some text files and generally make the drive quite different from its initial installed state. Now use a few of the solutions to create images on the backup partition and test. Depending on disk size you may have to delete each image after testing--just quick reformat the backup partition and do one test at a time. To do a good test, after taking the image, make some radical changes to the look & feel and uninstall some of the software. Restore from image and compare the restored drive to your recollection of the state when you took the image.

Back to topic--how are coming compiling?

J,R,D, Ltd
Posts: 53
Joined: Mon Dec 27, 2010 6:31 am
Operating System: Please select

Re: Having alot of trouble compiling Audacity from SVN

Post by J,R,D, Ltd » Wed Mar 02, 2011 4:12 am

@Steve: Thanks I'll check those out.

On Topic: Ok, something must be going screwy here. I removed MSVC++ 2010 and tried again with no success, well, that is to say I had incomplete success. After trying to build the Debug solution I get:
========== Build: 5 succeeded, 15 failed, 0 up-to-date, 0 skipped ==========

The errors are:
Project: wxregex: This error block occurs once for each of the files: regerror.c, regexec.c, regfree.c, and regcomp.c wrote: e:Building_AudacitywxWidgets-2.8.11includewx/defs.h(237) : error C2054: expected '(' to follow 'W'
e:Building_AudacitywxWidgets-2.8.11includewx/defs.h(237) : error C2085: 'WXTYPE' : not in formal parameter list
e:Building_AudacitywxWidgets-2.8.11includewx/defs.h(244) : error C2085: 'wxWindowID' : not in formal parameter list
D:Program FilesMicrosoft Visual Studio 9.0VCincludeassert.h(28) : error C2440: 'initializing' : cannot convert from 'char [2]' to 'unsigned int'
D:Program FilesMicrosoft Visual Studio 9.0VCincludeassert.h(28) : error C2440: 'initializing' : cannot convert from 'char [2]' to 'unsigned int'
D:Program FilesMicrosoft Visual Studio 9.0VCincludeassert.h(28) : error C2440: 'initializing' : cannot convert from 'char [2]' to 'unsigned int'
D:Program FilesMicrosoft Visual Studio 9.0VCincludeassert.h(28) : error C2440: 'initializing' : cannot convert from 'char [2]' to 'unsigned int'
D:Program FilesMicrosoft Visual Studio 9.0VCincludeassert.h(28) : error C2440: 'initializing' : cannot convert from 'char [2]' to 'unsigned int'
D:Program FilesMicrosoft Visual Studio 9.0VCincludeassert.h(28) : error C2085: '_wassert' : not in formal parameter list
D:Program FilesMicrosoft Visual Studio 9.0VCincludetchar.h(30) : warning C4081: expected ')'; found 'string'
D:Program FilesMicrosoft Visual Studio 9.0VCincludetchar.h(2057) : error C2085: '_TCHAR' : not in formal parameter list
D:Program FilesMicrosoft Visual Studio 9.0VCincludetchar.h(2058) : error C2085: '_TSCHAR' : not in formal parameter list
D:Program FilesMicrosoft Visual Studio 9.0VCincludetchar.h(2059) : error C2085: '_TUCHAR' : not in formal parameter list
D:Program FilesMicrosoft Visual Studio 9.0VCincludetchar.h(2060) : error C2085: '_TXCHAR' : not in formal parameter list
D:Program FilesMicrosoft Visual Studio 9.0VCincludetchar.h(2061) : error C2085: '_TINT' : not in formal parameter list
D:Program FilesMicrosoft Visual Studio 9.0VCincludetchar.h(2067) : error C2085: 'TCHAR' : not in formal parameter list
D:Program FilesMicrosoft Visual Studio 9.0VCincludetchar.h(2177) : error C2059: syntax error : '['
These errors occur for each of the following projects:base, core, odbc, xml, adv, html, net, gl, dbgrid, qa, richtext, aui, xrc, and media wrote: e:Building_AudacitywxWidgets-2.8.11includewx/defs.h(237) : error C2144: syntax error : 'short' should be preceded by ';'
e:Building_AudacitywxWidgets-2.8.11includewx/defs.h(237) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Rebuilding the solution multiple times does not help.

Just to make sure there weren't any ill effects from 2010 carrying over I made a virtual machine and installed Windows XP, VC++2008, wxWidgets-2.8.11, Tortoise-SVN, Python2.7, DirectX SDK (June 2011), Microsoft SQL Server 2008(it was included with VC++2008), Silverlight , and .Net 4. I have a system variable for WXWIN = C:wxWidgets-2.8.11 and on the Path variable I added ";C:Python27". And I did copy the new setup.h and access.cpp files.

And....... I got the same exact results as above. Then I decided to try reverting back to the wx files to see if it would work, first I used Audacity's setup.h and wx's access.cpp and it failed, then I swapped them, wx's setup.h and Audacity's access.cpp and it worked. So there must be a problem with the version of setup.h that is provided in the Audacity SVN.

I think I may have found the problem, line 1057 of setup.h, the wx version of the file reads:

Code: Select all

// instance is running.
The Audacity version reads:

Code: Select all

w// instance is running (available only under Win32).
Note the "w" which appears to be incorrect to me.

WOOT! Building the Debug solution worked! :D
========== Build: 15 succeeded, 0 failed, 5 up-to-date, 0 skipped ==========

This was probably the problem all along, now I need to build the other solutions but that will have to wait till tomorrow.

P.S. In case you didn't notice this was my log for the day.

Edgar
Forum Crew
Posts: 2043
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: Having alot of trouble compiling Audacity from SVN

Post by Edgar » Wed Mar 02, 2011 6:54 am

Well done! You are most likely right. It has been many months since I built wxWidgets. I looked at my copy of setup.h from SVN HEAD which I grabbed yesterday and this stray <w> is in mine as well. I will post a bug immediately.

Perseverance is rewarded by success! Keep us posted on your progress. Be warned that the current SVN HEAD is broken for compiling the (non-Unicode non-Debug) Release solution. the fix is:

The setting that needs to be changes is the "Link Time Code Generation" setting:

1) Load the Audacity solution into Visual Studio
2) Switch to the "Release" configuration
3) Select "Audacity Properties" from the "Project" menu
4) Expand the "Linker" item on the left
5) Select the "Optimization" item
6) Change the "Link Time Code Generation" property to "Default"
7) Click OK

I do not know why if has not been fixed yet.

J,R,D, Ltd
Posts: 53
Joined: Mon Dec 27, 2010 6:31 am
Operating System: Please select

Re: Having alot of trouble compiling Audacity from SVN

Post by J,R,D, Ltd » Fri Mar 04, 2011 3:09 am

Well wxWidgets compiled successfully in all the configurations you previously suggested to build. :D

Unfortunately, Audacity will not compile even after applying the fix you mentioned. I have posted the logs here: As you probably noticed I did not "Clean" the solution after each compile this time.
Here is part of the release log with most of it truncated to give you an idea of what's wrong.
------ Build started: Project: filedialog, Configuration: Release Win32 ------
Compiling...
cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release
FileDialog.cpp
e:building_audacityaudacity svnlib-srcfiledialogFileDialog.h(24) : fatal error C1083: Cannot open include file: 'wx/defs.h': No such file or directory
FileDialogPrivate.cpp
......lib-srcFileDialogwinFileDialogPrivate.cpp(24) : fatal error C1083: Cannot open include file: 'wx/wxprec.h': No such file or directory
Build log was saved at "file://e:Building_AudacityAudacity SVNwinProjectsfiledialogReleaseBuildLog.htm"
filedialog - 2 error(s), 1 warning(s)
...
========== Build: 0 succeeded, 3 failed, 24 up-to-date, 4 skipped ==========
Basically it seems to be looking for "wx/somefile.h" if I knew where it thought the directory "wx" was supposed to be then I could probably fix the problem.

Do you know how to fix this?

Edgar
Forum Crew
Posts: 2043
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: Having alot of trouble compiling Audacity from SVN

Post by Edgar » Fri Mar 04, 2011 5:40 pm

Your WXWIN path may not be set up properly. This is often a problem after running Visual Studio (not VC++ Express) then reverting to Express. Look at my environmental variables:
env.jpg
env.jpg (123.45 KiB) Viewed 4042 times
Feel free to post a screen shot of yours!

Edgar
Forum Crew
Posts: 2043
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: Having alot of trouble compiling Audacity from SVN

Post by Edgar » Fri Mar 04, 2011 5:50 pm

With fear & trembling you may also examine the Registry entry with regedit (this is not for the uninitiated--if you do not understand the Registry DO NOT EDIT IT! though it is probably safe to search it <grin>):
reg.jpg
reg.jpg (158.55 KiB) Viewed 4042 times

J,R,D, Ltd
Posts: 53
Joined: Mon Dec 27, 2010 6:31 am
Operating System: Please select

Re: Having alot of trouble compiling Audacity from SVN

Post by J,R,D, Ltd » Sat Mar 05, 2011 3:34 am

Yep, that was the problem, I had checked the variable yesterday but I didn't notice that the path was wrong.

So I tried to build the release project and everything was going good until near the end where I got this error:
FileNames.cpp
......srcFileNames.cpp(234) : error C2664: 'GetModuleHandleExA' : cannot convert parameter 2 from 'LPCWSTR' to 'LPCSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Audacity - 1 error(s), 0 warning(s)
========== Build: 26 succeeded, 1 failed, 0 up-to-date, 4 skipped ==========
The debug project had the same error
========== Build: 26 succeeded, 1 failed, 0 up-to-date, 4 skipped ==========

Then I built the unicode debug project and it worked! :)
========== Build: 5 succeeded, 0 failed, 23 up-to-date, 3 skipped ==========
I went to the exe and it loaded up Audacity just like it should, I didn't test it except for going to "about Audacity".

Then I built the unicode release project and it also worked! :)
========== Build: 29 succeeded, 0 failed, 0 up-to-date, 2 skipped ==========
I went to the exe and it loaded up Audacity just like it should, I didn't test it except for going to "about Audacity".

What is the difference between the unicode and non-unicode versions?

Edgar
Forum Crew
Posts: 2043
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: Having alot of trouble compiling Audacity from SVN

Post by Edgar » Sat Mar 05, 2011 5:33 pm

Congratulation!

Recently the (non-Unicode) Debug & Release builds have been broken. If you grab a SVN HEAD today they should build.

The non-Unicode builds are not really supported anymore and as soon as 2.0 releases should become completely extinct. The problem is that Windows98 will not run the Unicode versions and Audacity wishes to release a final stable Release version of 2.0 for Win98.

Have you ever seen a non-English word with letters like these?: [editorial aside--how do you punctuate a question mark and colon]
letters.jpg
letters.jpg (18.88 KiB) Viewed 4031 times
If you try to use Unicode characters in a non-Unicode version bad things will happen, especially when you try to save to disk or open a project someone else sends you with Unicode characters. The moral is, on any system except Win98, stick with Unicode to be safe.

J,R,D, Ltd
Posts: 53
Joined: Mon Dec 27, 2010 6:31 am
Operating System: Please select

Re: Having alot of trouble compiling Audacity from SVN

Post by J,R,D, Ltd » Sun Mar 06, 2011 2:29 am

Thank you! :)

So they published the fix today. I just recompiled the debug project and it worked I also recompiled the release project and it worked.

Ok, so non-English letters require Unicode. And the Unicode release is all-around better.

I suppose I am ready to try to compile with ASIO now. Do I pretty much just need to define the "ASIOSDK_DIR" environment variable and recompile Audacity?

Edgar
Forum Crew
Posts: 2043
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: Having alot of trouble compiling Audacity from SVN

Post by Edgar » Mon Mar 07, 2011 4:02 pm

J,R,D, Ltd wrote: I suppose I am ready to try to compile with ASIO now. Do I pretty much just need to define the "ASIOSDK_DIR" environment variable and recompile Audacity?
The only think to remember is that once you define the ASIO environmental variable and compile it is cumbersome to go back to standard. To revert, you will need to remove (or rename) the ASIO environmental variable and completely delete the entire Audacity directory into which you first SVNed the trunk. Then re-create the directory and do a new SVN checkout into it and recompile. I do not think there is anything in audacity.cfg (the configuration file) which will impact restoring to standard, but it might be a good idea to at least inspect it for ASIO related entries--if found then delete or initialize (i.e. remove all but the first line) it.

Good luck so far, keep us posted on your ASIO results. Don't be surprised if you find pitfalls along the way and do not expect wondrous results--YMMV!

Post Reply