Audacity VS2010 project construction

Audacity's VS2015 project is already available online, https://blog.csdn.net/weixin_34224941/article/details/93950373

According to these instructions, you can build a relatively stable version of vs2015 (vs2017)

I am here mainly for nostalgia, using the old version of vs2010 to build a lightweight audacity project for debugging

The compilation of audacity requires wxWidgets, and different versions of audacity depend on different wxWidgets

Under the audacity project, there is an audacity.sln under \Audacity_x_x_x\win\, which gives the sln file that can be compiled by vs. In addition, check the configure file under the audacity project package to get the version number of the wxWidgets it depends on, such as opening A configure file for

audacity 2.2.0 VS 2013 wxWidgets v3.0.x
audacity 2.2.0-rc1 VS 2013 wxWidgets v3.0.x
audacity 2.1.3 vs2013 wxWidgets v3.0.x
audacity 2.1.0 vs2013 (there is no intermediate version) wxWidgets is 2.8.x
audacity 2.0.6 vs208 wxWidgets is 2.8.x
audacity 2.0.2 vs2008 wxWidgets is 2.8.x
audacity 2.0.0 vs208 wxWidgets is 2.8.x

The audacity project is now hosted on github,

You read that right, there is no transitional version between 0.6 and 1.0, and there is no official vs2010 sln file for you

To put it bluntly, if you want to use vs2010, audacity 2.0.6 and audacity 2.1.0 vs2013 should be the best choices, and the wx it depends on is 2.8.x

1. wxX11-2.8.12 configuration

https://v.youku.com/v_show/id_XMjYzMjg0NTg4.html?refer=seo_operation.liuxiao.liux_00003303_3000_Qzu6ve_19042900

First compile wxWidgets 2.8.12, find the package from the Internet, and open config.vc under build\msw

Change SHARED to 1, UNICODE to 1

The main reason is that audacity uses unicode codes, we have to cooperate

nmake -f config.vc

A dynamic library will be generated under lib\vc_dll

Set an environment variable: WXWIN, navigate to your wxX11-2.8.12 directory

Second, the configuration of audacity

Download the 2.0.6 package, open the sln file with vs2010, and compile it. Most of the projects are fine, only the following four are not working

Audacity (main project)

locale

lv2

portaudio-v19

There is nothing to say, let's break through each one! Stubborn!

1、portaudio-v19

The problem is that it needs to generate a config.h under the following directory for calling

In fact, it is to check whether your system has installed the following audio library or which driver is used. Now take a config.h and open it to see (this is a later story)

If it didn't generate, it must have encountered some obstacles.

I don't compile ASIO anymore, if you need ASIO, see the documentation:

https://manual.audacityteam.org/man/asio_audio_interface.html

https://forum.audacityteam.org/viewtopic.php?t=95663

Change it slightly:

PreBuildEvent

echo on
setlocal enabledelayedexpansion
set CFG="$(ProjectDir)/$(Configuration)/config.h"

echo // Automatically generated file >!CFG!
IF NOT "%DXSDK_DIR%" == "" echo #define PA_USE_DS 1 >>!CFG!
IF NOT "%ASIOSDK_DIR%" == "" echo #define PA_USE_ASIO 0 >>!CFG!
IF NOT "%JACKSDK_DIR%" == "" echo #define PA_USE_JACK 1 >>!CFG!
IF NOT "%JACKSDK_DIR%" == "" echo #define PA_DYNAMIC_JACK 1 >>!CFG!
rem echo #define PA_USE_WDMKS 1 >>!CFG!
echo #define PA_USE_WASAPI 1 >>!CFG!
echo #define PA_USE_WMME 1 >>!CFG!

PostBuildEvent

echo on
setlocal enabledelayedexpansion
set BASE=../../../lib-src/portaudio-v19
set CFG=$(ProjectDir)$(Configuration)\config.h
set INTDIR=$(Configuration)
set CFLAGS=/Od /I "!BASE!/include" /I "!BASE!/src/common" /I "!BASE!/src/os/win" /D "WIN32" /D "_DEBUG" /D "_LIB" /D "_MBCS" /GF /FD /EHsc /RTC1 /MDd /Gy /W3 /nologo /c /ZI /wd4996 /Fo"!INTDIR!/" /FI "!CFG!" /errorReport:prompt
set LIBS=

find "PA_USE_DS 1" "!CFG!"
IF ERRORLEVEL 1 goto NoDS

cl !CFLAGS! /I "%DXSDK_DIR%/include" "!BASE!/src/hostapi/dsound/pa_win_ds.c"
cl !CFLAGS! /I "%DXSDK_DIR%/include" "!BASE!/src/hostapi/dsound/pa_win_ds_dynlink.c"

set LIBS="%DXSDK_DIR%/lib/x86\dxguid.lib"

:NoDS

find "PA_USE_WASAPI 1" "!CFG!"
IF ERRORLEVEL 1 goto NoWASAPI

cl !CFLAGS! "!BASE!/src/hosta/back/pa_win_back.c"

:NoWASAPI

find "PA_USE_WDMKS 1" "!CFG!"
IF ERRORLEVEL 1 goto NoWDMKS

cl !CFLAGS! "!BASE!/src/hostapi/wdmks/pa_win_wdmks.c"

:NoWDMKS

find "PA_USE_ASIO 1" "!CFG!"
IF ERRORLEVEL 1 goto NoASIO

cl !CFLAGS! /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "!BASE!/src/hostapi/asio/pa_asio.cpp"
cl !CFLAGS! /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "!BASE!/src/hostapi/asio/iasiothiscallresolver.cpp"
cl !CFLAGS! /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "%ASIOSDK_DIR%/common/asio.cpp"
cl !CFLAGS! /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "%ASIOSDK_DIR%/host/asiodrivers.cpp"
cl !CFLAGS! /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "%ASIOSDK_DIR%/host/pc/asiolist.cpp"

:NoASIO

find "PA_USE_JACK 1" "!CFG!" >NUL
IF ERRORLEVEL 1 goto NoJACK

cl !CFLAGS! /I "%JACKSDK_DIR%/includes" "!BASE!/src/hostapi/jack/pa_jack.c"
cl !CFLAGS! /I "%JACKSDK_DIR%/includes" "!BASE!/src/hostapi/jack/pa_jack_dynload.c"

: And JACK

lib /OUT:"$(TargetPath)" "!INTDIR!/*.obj" !LIBS!

Go style!

Successfully compiled, good! The old doctor of traditional Chinese medicine specializes in treating difficult and miscellaneous diseases!

2、lv2

It seems that some basic macro definitions are not defined correctly

Just use the one that comes with vs2010, don’t worry about it

Hide stdint.h in the lv2 directory!

OK! , one bullet kills one enemy

3、locale

It turns out that msgfmt is needed, go

http://gnuwin32.sourceforge.net/packages/gettext.htm

Download gettext-0.14.4-bin.zip

Give him the required documents

Just find one libiconv2 online

put in place

Compile and go! OK, hat trick!

4. Big project, audacity

Our goal is to remove the double quotes below!

It’s useless for you to change vcxproject (Audacity.vcxproj) here. It’s a smoke bomb after trying for a long time.

The file to be moved is ny.props, change it to remove the double quotes

 Compile again, it seems that there is something wrong with the symbol

 Needless to say, this problem was mentioned in https://blog.csdn.net/weixin_34224941/article/details/93950373

It must be double quotes, let’s do it again rebuild all

Well, pass five levels and kill six generals!

 Just copy all kinds of wxbase28ud_xxx_dll under \wxX11-2.8.12\lib\vc_dll to the debug directory

Well, it's time to enjoy the fruits of your labor, after all, it's a familiar taste!

Okay, stop talking about gossip, and come directly to the dry goods:

Link: https://pan.baidu.com/s/10BAnN-woGORTVJ6u9yXd1w

Extraction code: du3b

Guess you like

Origin blog.csdn.net/book_bbyuan/article/details/102951821