[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
J,R,D, Ltd
Posts: 53
Joined: Mon Dec 27, 2010 6:31 am
Operating System: Please select

[Solved] Trouble compiling Audacity from SVN with ASIO

Post by J,R,D, Ltd » Fri Feb 25, 2011 9:49 pm

Hi, I got very aggravated with this last night after it taking me four days to finally get all the programs, SDKs and other various things together.

I first downloaded Visual Studio 2010 and then after trying to compile and it failing I found it said on the forum that 2010 doesn't work so I searched for 2008 and finally found it, I left 2010 installed and installed 2008. Hopefully 2010 isn't still screwing this up even though it isn't being used. Do you think I should uninstall 2010? Please give your opinion.

Here is some background on my development environment:
  • Win XP SP 3
  • 2.4GHz Celeron
  • 1.5GB RAM
  • Environment Variables:(The guide didn't say whether they should be "User" or "System" so after failing a couple times I made them "System" variables as well.)
    • User:
      • ASIOSDK_DIR = E:Building_AudacityASIOSDK2
      • WXWIN = E:Building_AudacitywxWidgets-2.8.11
    • System:
      • ASIOSDK_DIR = E:Building_AudacityASIOSDK2
      • WXWIN = E:Building_AudacitywxWidgets-2.8.11
      • DXSDK_DIR = D:Pragram FilesMicrosoft DirectX SDK (June 2010)
      • PATH = (Appended to the end) D:Python27
  • The Audacity source code is located at E:Building_AudacityAudacity SVN
  • I am using revision 10959 as of 3:07 pm EST-5 2-25-2011
  • I am using Visual C++ 2008 Express Edition (Version 9.0.30729.1 SP)
  • I also have C++ 2010 installed but I am not using it.
Starting at the beginning of the compile instructions here is how it goes:
---------------------------
MSVC++ STEP 1: Download wxWidgets
---------------------------

I downloaded wxMSW-2.8.11-Setup.exe and installed it to E:Building_AudacitywxWidgets-2.8.11

------------------------
MSVC++ STEP 2: Build wxWidgets
------------------------

I don't understand why wxWidgets doesn't come built already but that's how it is.

1. I loaded E:Building_AudacitywxWidgets-2.8.11buildmswwx_dll.dsw I now have a file named wx_dll.sln.

2. I moved the files access.cpp and setup.h from E:Building_AudacityAudacity SVNwinwxWidgets_additions to E:Building_AudacitywxWidgets-2.8.11srcmswoleaccess.cpp and E:Building_AudacitywxWidgets-2.8.11includewxmswsetup.h

3. This guide does not say how to build projects so you are left to find it yourself. The first time I just did "Build Solution" under the build menu. Later down it says to use "Batch Build..." under the Build menu. So I went to Build->Batch Build..." I selected DLL Debug, DLL Release, DLL Unicode Debug, and DLL Unicode Release for projects: adv, base, core, html, and net. And then I hit "Build" it is now throwing many errors, is this normal?
The build failed.
========== Build: 0 succeeded, 24 failed, 20 up-to-date, 0 skipped ==========

Please read the build log which you can see here as I do not know what the errors mean and there are too many to list here unless I need to.

On previous days I have gone on but today I am not going to because it is not going to work and I am sure this needs to work first.

Please help me out with this, thanks in advance, Ricky.
Last edited by J,R,D, Ltd on Sun Mar 20, 2011 4:32 am, edited 1 time in total.

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 Feb 25, 2011 10:37 pm

As to keeping 2010, the answer is "probably not". It might be OK to keep (but still would not compile Audacity) if 2008 was installed first. Unless you really need 2010 as a development environment I would uninstall it (if you have a system image from just before you started all this I would suggest you revert to it as I had registry problems after uninstalling 2010). Part of the problem seems to be that VC++2008 Express in a bit incompatible with VS2010 because of conflicting libraries and system variables. Also, installing VS2010 hijacks the file associations to it is difficult to open VC++2008 files in VC++2008--they want to open on VS2010.

Until you get wxWidgets & Audacity both compiling rename your ASIO system variable xASIOSDK_DIR so it will not be found; remove the ASIO user variable if you have not done so and do not reimplement it--my experience having it a USER variable was a show stopper. WXWIN may be a USER variable but I would suggest it not being both--why ask for confusion; I have never set it as a system variable but only have one user on my box (Win7 now, previously Vista).
I don't understand why wxWidgets doesn't come built already but that's how it is.
Building wxWidgets is a rite of passage! <grin>

The big hurdle is to compile wxWidgets; you must use voodoo magic (i.e. follow the steps exactly as specified paying attention to all the little undocumented ones!

I am going to offer some tips for compiling wxWidgets--hope the forum police do not hate me!

1) look at this: http://wiki.audacityteam.org/index.php? ... On_Windows (if you are not using Windows, the links at the very top of this page to other operating systems will be of interest). You will need to follow the instructions for getting wxWidgets and Audacity compiled very carefully and explicitly.

2) look at this: http://wiki.wxwidgets.org/Microsoft_Vis ... B%2B_Guide if the following is not enough!

As with all things digitally logical it is imperative to follow the initial instructions explicitly. Make sure that before you do anything else you do those two file things (setup.h and #define wxUSE_ODBC) and set the environmental variable WXWIN. If you have tried to compile already without following these steps or are having failure to compile problems, completely delete wxWidgets, reinstall it, set the environmental variable, copy setup.h and then do the #define.

WxWidgets -- Setup.h not found? Before you try to compile any of wxWidgets you must make sure to follow the directions about copying Setup.h into the appropriate directory for your system! Read the WxWidgets Forum FAQ on this http://wxforum.shadonet.com/viewtopic.php?t=255.

Make sure to choose the proper workspace—there are two vc++ 6 workspaces – wx.dsw and wx_dll.dsw, you absolutely must choose wx_dll to convert into a VC++ 9 Solution (that’s what VC++ and Visual Studio 2008 use). Use your favorite method to open wx_dll in VC++ 2008 Express (or Microsoft Visual Studio 2008). A dialog will open offering you the chance to “convert all” – do so. After the conversion is done and IntelliSense is finished scanning all files (watch the status bar at the extreme lower left corner) close VC++ and say yes to saving the solution. You will now have a Visual Studio Solution—wx_dll.sln, from now on this is what you want to open in VC++.

Open the newly saved solution, use the Configuration Manager (either from the toolbar or from the menu) to first build the Debug configuration. Because the build order is not always set correctly you may have to rebuild any given configuration a few times until you get zero errors. If for some reason after rebuilding 5 times you still are failing to build completely you have a problem, most likely it is with the hierarchy of dependencies (refer to 2 above).

After the Debug solution is built build the other configurations in this EXACT order: Release, Unicode Debug, Unicode Release, DLL Debug, DLL Release, DLL Unicode Debug, DLL Unicode Release. You may safely ignore all the Universal configurations.

Instead of trying to build the entire Sample solution at once, go in and choose a single sample; the last couple of days I have been working on the scroll sample, let’s try that specific one now.

Open the scroll folder and look for scroll.dsp (a VC++ project). Use your favorite method to open it in VC++ 2008 Express (or Microsoft Visual Studio 2008). A dialog will open offering you the chance to “convert all” – do so. After all the conversion is done and IntelliSense is finished scanning all files (watch the status bar at the extreme lower left corner) close VC++ and say yes to saving the solution. You will now have a Visual Studio Solution—scroll.sln, from now on this is what you want to open in VC++. Open it, using the Configuration Manager use Unicode Debug to build a solution—if it runs build a Unicode Release solution, if that runs you are all set to go! If you cannot get to this point get back in touch with me with specific questions and problems.

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 Feb 25, 2011 11:20 pm

Now for the Audacity stuff...

Start here: http://wiki.audacityteam.org/index.php? ... On_Windows

Download and install TortoiseSVN (make sure you get the 64-bit versions if your OS is 64-bit). After you have gotten wxWidgets and Audacity to compile and run but BEFORE you make any changes to the code use Windows Explore to make copies of both of those entire folders. WxWidgets should remain static but you never know you might need to make changes; if you do make the changes in the original folder keep the copy pristine.

On my system I have Audacity SVN HEAD here:
D:\AudacitySVN
after TortoiseSVN is installed on your system, single-right-click that SVN folder to open the context menu; one of the items should be "SVN checkout...", choose it and a dialog will open:
checkout.jpg
checkout.jpg (82.08 KiB) Viewed 6904 times
make sure the repository is:

Code: Select all

http://audacity.googlecode.com/svn/audacity-src/trunk/
make sure the checkout directory points to where you want the Audacity code to go; make sure depth is Fully recursive; make sure HEAD is checked--click OK. It will take a few minutes.

Getting wxWidgets and Audacity to play nicely together the first time is a chore. If you start out wrong with wxWidgets sometimes you have to delete the entire wxWidgets directory and reinstall it because of the way they use setup.h. Once you have all the wxWidgets libraries built they need to be copied (not moved) into your win folder (mine is at: D:\AudacitySVNwin); the easiest I have found is to store copies in your Audacity folder so you have a structure which looks like:
Directory of D:Audacity
build directories

Directory of D:Audacitybuild directories
ALL wx2.8.11 libs

Directory of D:Audacitybuild directoriesALL wx2.8.11 libs
Debug
Release
Unicode Debug
Unicode Release

Directory of D:Audacitybuild directoriesALL wx2.8.11 libsDebug
205,824 wxbase28d_net_vc_custom.dll
2,038,784 wxbase28d_vc_custom.dll
1,024,512 wxmsw28d_adv_vc_custom.dll
4,643,840 wxmsw28d_core_vc_custom.dll
713,216 wxmsw28d_html_vc_custom.dll

Directory of D:Audacitybuild directoriesALL wx2.8.11 libsRelease
115,712 wxbase28_net_vc_custom.dll
1,093,120 wxbase28_vc_custom.dll
674,816 wxmsw28_adv_vc_custom.dll
2,745,856 wxmsw28_core_vc_custom.dll
468,480 wxmsw28_html_vc_custom.dll

Directory of D:Audacitybuild directoriesALL wx2.8.11 libsUnicode Debug
210,944 wxbase28ud_net_vc_custom.dll
2,173,440 wxbase28ud_vc_custom.dll
1,043,968 wxmsw28ud_adv_vc_custom.dll
4,789,248 wxmsw28ud_core_vc_custom.dll
719,360 wxmsw28ud_html_vc_custom.dll

Directory of D:Audacitybuild directoriesALL wx2.8.11 libsUnicode Release
118,784 wxbase28u_net_vc_custom.dll
1,145,856 wxbase28u_vc_custom.dll
677,888 wxmsw28u_adv_vc_custom.dll
2,761,216 wxmsw28u_core_vc_custom.dll
472,064 wxmsw28u_html_vc_custom.dll

The newer Audacity VC++2008 solutions are all ready to go (no conversion required) so open audacity.sln with VC++2008 (on my system it is at D:\AudacitySVNAudacity.sln). Before you compile Audacity copy all four of the configuration folders (Debug, Release, Unicode Debug & Unicode Release) from D:Audacitybuild directoriesALL wx2.8.11 libs (or wherever you have your storage folder) into the win folder (again, mine is at D:\AudacitySVNwin). For now (22Feb11--as of the last few days the Debug & Release configurations will not build) select one of the Unicode configurations and "Build Audacity" from the Build menu.

Please let me know if you find any errors of omission or commission in these posts!

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 Feb 25, 2011 11:33 pm

Now that you have wxWidgets compiled and Audacity compiled and running you may attempt ASIO. Be warned, once you define the ASIO system variable it can be a hassle to go back!

After you download the ASIO SDK you will have a zip file: asiosdk2.2.zip; unzip it and you will have asiosdk2.2/ASIOSDK2, the system variable must point to the ASIOSDK2 folder (on my system I put it at: D:asiosdk2.2ASIOSDK2).

Open VC++2008 on your Audacity solution and from the Build menu choose "Clean Audacity", then from the Build menu choose "Build Audacity". This cause Audacity to recreate a lot of it's internal compiling structure and recompile everything with ASIO support.

If you ever want to remove ASIO support change the name of the ASIO system variable (so Audacity will not recognize it--you could delete it as well) then open VC++2008 on your Audacity solution and from the Build menu choose "Clean Audacity", then from the Build menu choose "Build Audacity". This will restore the files without ASIO support.

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 Feb 26, 2011 4:14 am

Edgar wrote:As to keeping 2010, the answer is "probably not". It might be OK to keep (but still would not compile Audacity) if 2008 was installed first. Unless you really need 2010 as a development environment I would uninstall it (if you have a system image from just before you started all this I would suggest you revert to it as I had registry problems after uninstalling 2010). Part of the problem seems to be that VC++2008 Express in a bit incompatible with VS2010 because of conflicting libraries and system variables. Also, installing VS2010 hijacks the file associations to it is difficult to open VC++2008 files in VC++2008--they want to open on VS2010...
Thanks for the info Edgar I will try your method. I do have a restore point from before starting so I guess I will try that and then reinstall VC++2008, DXSDK, TortoiseSVN, Python and anything else I missed that I need.

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 Feb 26, 2011 11:49 pm

J,R,D, Ltd wrote:
Edgar wrote:Unless you really need 2010 as a development environment I would uninstall it (if you have a system image from just before you started all this I would suggest you revert to it
Thanks for the info Edgar I will try your method. I do have a restore point from before starting so I guess I will try that and then reinstall VC++2008, DXSDK, TortoiseSVN, Python and anything else I missed that I need.
A restore point is not a system image. A system image is an exact bitwise compressed copy of your C: drive. Resetting to an older restore point is generally a waste of time and often causes many more problems (IMVHO).

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 Feb 27, 2011 4:10 am

Edgar wrote:
J,R,D, Ltd wrote:
Edgar wrote:Unless you really need 2010 as a development environment I would uninstall it (if you have a system image from just before you started all this I would suggest you revert to it
Thanks for the info Edgar I will try your method. I do have a restore point from before starting so I guess I will try that and then reinstall VC++2008, DXSDK, TortoiseSVN, Python and anything else I missed that I need.
A restore point is not a system image. A system image is an exact bitwise compressed copy of your C: drive. Resetting to an older restore point is generally a waste of time and often causes many more problems (IMVHO).
Oh great, well thanks for telling me that, I guess I should undo the system restore and go in with RevoUninstaller and get rid of M$VC++2010 fully. How does that sound?
As with all things digitally logical it is imperative to follow the initial instructions explicitly. Make sure that before you do anything else you do those two file things (setup.h and #define wxUSE_ODBC) and set the environmental variable WXWIN. If you have tried to compile already without following these steps or are having failure to compile problems, completely delete wxWidgets, reinstall it, set the environmental variable, copy setup.h and then do the #define.
Where am I supposed to do this "#define wxUSE_ODBC" none of the guides I have read so far mention anything about it. Excuse me, I take part of that back, the wx install.txt file does list it and says where it is but it does not say it is required for Audacity. However I did some investigating and searched the setup.h file that the Audacity compile.txt says to put into "wxWidgets-2.8.11includewxmsw" and I found:

Code: Select all

// Define 1 to use ODBC classes
#define wxUSE_ODBC          1 // Turn it on for Audacity.
So unless I am mistaken the defining has already been done by the Audacity devs and does not need to be done again. Am I right?

Thanks for helping me.

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 6:42 am

J,R,D, Ltd wrote:I should undo the system restore and go in with RevoUninstaller and get rid of M$VC++2010 fully. How does that sound?
Yes, sounds good. I really suggest you find a tool (I do not recall if XP has one built in) to make system images.
J,R,D, Ltd wrote: So unless I am mistaken the defining has already been done by the Audacity devs and does not need to be done again. Am I right?
Yes, just make sure that you completely re-compile wxWidgets after making the setup.h change.

Are you having any luck? I have been doing a lot of Audacity hacks (non-Developer supported code tweaks) under Windows (Vista at first, now 7). I also do a bit of bug testing and (very rarely) offer code to the Developers in support of bugs (they are in feature freeze so will not consider my tweaks). This last week I got roped into installing Linux and compiling Audacity & wxWidgets to work on a Linux-specific bug--I feel your pain <grin>!

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 Feb 27, 2011 6:44 pm

Edgar wrote:Yes, sounds good. I really suggest you find a tool (I do not recall if XP has one built in) to make system images.
That's a good idea. I prefer open source and free programs so any recommendations would be appreciated. To anyone reading this, you can recommend software also, Edgar doesn't have to do all the posting.
Edgar wrote:Yes, just make sure that you completely re-compile wxWidgets after making the setup.h change.
I haven't gotten it to compile once yet and I changed setup.h before trying to compile wxWidgets.
Edgar wrote:Are you having any luck? I have been doing a lot of Audacity hacks (non-Developer supported code tweaks) under Windows (Vista at first, now 7). I also do a bit of bug testing and (very rarely) offer code to the Developers in support of bugs (they are in feature freeze so will not consider my tweaks). This last week I got roped into installing Linux and compiling Audacity & wxWidgets to work on a Linux-specific bug--I feel your pain <grin>!
I have not attempted it again yet since the last post because I have so much to do with removing MSVC++2010 first.

Can a windows version of Audacity be compiled on linux? I have Ubuntu and would be willing to use it if it would be easier.

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Having alot of trouble compiling Audacity from SVN

Post by steve » Sun Feb 27, 2011 10:05 pm

J,R,D, Ltd wrote:
Edgar wrote:Yes, sounds good. I really suggest you find a tool (I do not recall if XP has one built in) to make system images.
That's a good idea. I prefer open source and free programs so any recommendations would be appreciated.
There's a list of possibilities here: http://www.thefreecountry.com/utilities ... mage.shtml
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply