part the second…let us skip back a few lines in the previous post to the point where it says “The next chore will be to fix portmixer…”.
Before you change that Yes into a No, this might be a good time to try compiling Audacity before you make any changes to the property pages. In the previous message I dealt with known bugs of Microsoft’s updater dealing with “rules” files; the problems were reported in the beta almost 2 years ago and the beta testers were assured that they would be fixed “immediately if not sooner” but it appears nothing has been done. They did say that the problem was way down on their to-do list because it only affected a tiny fraction of users.
The rest of the problems I had only exhibited because I had the Microsoft DirectX SDK installed. If you do not have it installed you might not need to make the following changes. If you do have the problem you might see errors that look like this:
Error 13 error C1083: Cannot open source file: 'ILAGSDXSDK_DIR/src/hostapi/dsound/pa_win_ds.c': No such file or directory D:SVNwinProjectsportaudio-v19c1
Error 14 error C1083: Cannot open source file: 'ILAGSDXSDK_DIR/src/hostapi/dsound/pa_win_ds_dynlink.c': No such file or directory D:SVNwinProjectsportaudio-v19c1
Error 15 error MSB3073: The command "set BASE="../../../lib-src/portaudio-v19"
set CFLAGS=/Od /I "ºSE%/include" /I "ºSE%/src/common" /I "ºSE%/src/os/win" /D "WIN32" /D "_DEBUG" /D "_LIB" /D "_MBCS" /GF /FD /EHsc /RTC1 /MDd /Gy /Fo"Debug" /Fd"Debug" /W3 /nologo /c /ZI /wd4996 /FI "D:SVNwinProjectsportaudio-v19/Debug/config.h" /errorReport:prompt
set LIBS=
if "%DXSDK_DIR%"=="" goto NoDX
cl ÏLAGS% /I "%DXSDK_DIR%/include" "ºSE%/src/hostapi/dsound/pa_win_ds.c"
cl ÏLAGS% /I "%DXSDK_DIR%/include" "ºSE%/src/hostapi/dsound/pa_win_ds_dynlink.c"
set LIBS="%DXSDK_DIR%/lib/x86dxguid.lib"
:NoDX
if "%ASIOSDK_DIR%"=="" goto NoASIO
cl ÏLAGS% /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "ºSE%/src/hostapi/asio/pa_asio.cpp"
cl ÏLAGS% /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "ºSE%/src/hostapi/asio/iasiothiscallresolver.cpp"
cl ÏLAGS% /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "%ASIOSDK_DIR%/common/asio.cpp"
cl ÏLAGS% /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "%ASIOSDK_DIR%/host/asiodrivers.cpp"
cl ÏLAGS% /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "%ASIOSDK_DIR%/host/pc/asiolist.cpp"
:NoASIO
lib /OUT:"D:SVNwinDebugportaudio-v19.lib" "Debug*.obj" %LIBS%
:VCEnd" exited with code -1. C:Program Files (x86)MSBuildMicrosoft.Cppv4.0Microsoft.CppCommon.targets 113
(I tightened up the spacing by removing blank lines from the error message).
If you refer back to the large picture at the bottom of the previous post you will see where we need to start to fix the compile problems with portmixer; follow the instructions in the previous post which start out with “The next chore…” and open the Properties page for portmixer. You will need to change all of the solutions which you wish to compile (Debug, Release, Unicode Debug and Unicode Release); the process is quite similar for each but you cannot just copy one change to all four solutions.
Referring back to the picture, the text of the original Post-Build Event is:
set BASE="../../../lib-src/portmixer"
set CFLAGS=/Od /I "%BASE%/../portaudio-v19/include" /I "%BASE%/include" /D "WIN32" /D "_DEBUG" /D "_LIB" /D "PX_USE_WIN_MME" /D "_MBCS" /GF /FD /EHsc /RTC1 /MDd /Gy /Fo"$(IntDir)" /Fd"$(IntDir)" /W3 /nologo /c /ZI /wd4996 /FI "$(ProjectDir)/$(Configuration)/config.h" /errorReport:prompt
set LIBS=
if "%DXSDK_DIR%"=="" goto NoDX
cl %CFLAGS% /I "%DXSDK_DIR%/include" "%BASE%/src/px_win_ds.c"
set LIBS="%DXSDK_DIR%/lib/x86/dxguid.lib"
:NoDX
lib /OUT:"$(TargetPath)" "$(IntDir)*.obj" %LIBS%
The first problem is the line that reads:
set LIBS=
in which it is setting a variable called LIBS equal to nothing; this seems to be just fine in 2008 but 2010 seems to choke on it so just get rid of it.
The next problem has to do with the first “if” statement:
if “%DXSDK_DIR%”==“” goto NoDX
what this line says is “if you have an environmental variable set to point to a DirectX SDK folder, do the next two statements”. The problem with this is that the file “px_win_ds.c” is set to “Exclude From Build” and this setting is contrary to the commandline instruction:
cl %CFLAGS% /I “%DXSDK_DIR%/include” “%BASE%/src/px_win_ds.c”
which tells the compiler to compile it. This was just fine in 2008 but 2010 chokes on it. There are two solutions you can turn the “Exclude From Build” setting from Yes to No and there will be no conflict or you can get rid of all lines leaving just the last line. Remember, you will need to do this for each Solution you want to build.
I also had a problem with the expansion of the BASE and CFLAGS variables because of the length of my folder names (all my folder names where the default folder names as installed by Microsoft and/or Audacity; my Audacity folder is in the root of my hard drive and is called audacity2010, so I could not get my folder names much smaller even though I did try naming my Audacity folder D:A – that did not help). The problem is not with the length of the line presented to the compiler, the problem is with 2010’s expansion of the variables – these exact same folder names (in fact considerably longer) work just fine in 2008.
What I ended up having to do was get rid of the BASE and CFLAGS variables completely and replace each variable with a fully qualified path:
if "%DXSDK_DIR%"=="" goto NoDX
cl /Od /I "D:Alib-srcportaudio-v19include" /I "D:Alib-srcportmixerinclude" /D "WIN32" /D "_DEBUG" /D "_LIB" /D "PX_USE_WIN_MME" /D "_MBCS" /GF /FD /EHsc /RTC1 /MDd /Gy /Fo"$(IntDir/)" /Fd"$(IntDir)/" /W3 /nologo /c /ZI /wd4996 /I "C:Program Files (x86)Microsoft DirectX SDK (June 2010)include" "D:Alib-srcportmixersrcpx_win_ds.c"
set LIBS="C:Program Files (x86)Microsoft DirectX SDK (June 2010)Libx86dxguid.lib"
:NoDX
lib /OUT:"$(TargetPath)" "$(IntDir)*.obj" %LIBS%
You will see in the above fully qualified paths that look like:
“D:Alib-srcportaudio-v19include”
and you can see that I made my Audacity folder’s name “A”; I eventually changed my personal build to where that folder’s name is “audio/Audacity/SVN2010” and even with that somewhat lengthy addition I had no trouble compiling. My guess is that you can have that compile line somewhere out in the neighborhood of 512 characters - at least that’s what I recall from 20 years ago – the last time I dealt with commandline compiling !
*EDIT 11 October 2013
It has been a while now and it seems that VC++ 2010 is a little bit happier with expanding strings but I had to use:
$(ProjectDir)......lib-src
everywhere for the folder reference to lib-src.
*End Edit
If you look at the very end of the original commandline compile (cl) statement and compare it to my version you will see that there are a few differences. In the original version the compiler supplied the slashes inherent in expanding “$(IntDir)” but 2010 requires the user to supply the slashes; there are two places needing that treatment.
Another problem is with commandline switch /FI “$(ProjectDir)/$(Configuration)/config.h”, which tells the compiler to pre-compile the config.h header; this worked in 2008 but does not work in 2010 (I do not know why, I’m guessing it’s because of the way the variables ProjectDir and Configuration are expanded). It’s no big deal to just not pre-compile the header file so I just got rid of it.
Finally, you’ll note in the original, at the very end of the line:
/errorReport:prompt
which deals with the automatic transmittal of usage information to Microsoft – I just got rid of it.
If you wish to change the other solutions you cannot just copy all of this and paste it into each solution – the commandline switches are different!
Okay, right-click on the project portmixer in the Solution Explore and from the context menu choose Build (should be at the very top). If all goes well you will not have any errors. If you do have errors go back and examine each step along the way.
You must do the same thing for portaudio–19 but it is a tiny bit more complicated. In this case there are three files which are “turned off”:

follow the same procedure as outlined above to change the “Exclude From Build” from yes to no. Follow the same procedure as outlined above to expand the BASE and CFLAGS variables completely and replace both with fully qualified paths. Do not forget to remove the line that looks like:
set LIBS=
and don’t forget that you need to do the whole process for each Solution!
Now compile the portaudio-19 project; if you get an error it is probably a problem with finding an included header file. You may need to edit one of the source files.
lib-src/portaudio-v19/src/hostapi/dsound/pa_win_ds.c at line 105:
//#include “pa_win_wdmks_utils.h”
#include “…/…/os/win/pa_win_wdmks_utils.h”
Now that you have those two problem projects resolved right-click on the Audacity project and build it. Everything should go fine; good luck!.
Questions always welcome.