關於Audacity和需要用到的wxWidgets介紹就略去了。
編譯環境:
作業系統:windows 7
開發IDE:VS2008(編譯wxWidgets)和VS2010(編譯Audacity)
------------------------------------------------------------------------------------------
現在正是開始編譯:
第一步:下載wxWidgets
在試圖編譯Audacity之前,你必須下載和編譯wxWidgets,否則不能編譯成功!
wxWidgets可在http://www.wxwidgets.org/地方擷取,Audacity 1.3.14 需要 wxWidgets 2.8.12。在windows下編譯,下載wxMSW包(installer or zip,我用的installer)
第二步:編譯wxWidgets
When you have downloaded and installed wxWidgets, the next step is to build it.
當你下載並安裝了wxWidgets,接下來就編譯它。
1.用VS 2008開啟“C:\wxWidgets-2.8.12\build\msw\wx_dll.dsw”,確定你開啟的是wx_dll.dsw而不是wx.dsw,因為wx.dsw建立DLL不包含依賴性。當你開啟wx_dll.dsw時,Visual Studio提示你是否轉換,點擊“全是”(完畢後重新儲存一下工程),下次你能直接通過“C\wxWidgets-2.8.12\build\msw\wx_dll.sln”開啟Visual Studio以避免出現提示,而不再用wx_dll.dsw開啟。
2.如果你想要使用accessibility(可接入性)的特色,我們需要修改wxWidgets中的一個檔案,而不是打一個補丁,我們儲存任何修改的檔案在Audacity的程式碼程式庫,然後你可以替換這相應的wxWidgets檔案。
在“audacity\win\wxWidgets_additions”中有一個.h檔案,你也許想要備份一個wxWidgets原始檔案,這樣你可以不使用可訪問性特色進行編譯。
* 複製setup.h 到 "C:\wxWidgets-2.8.12\include\wx\msw\"下。
Audacity 的releases版是使用了可訪問性特色進行編譯的。
3.為你想要Audacity的所有配置建立對應wxWidgets
* 產生 "DLL Release"用於 Audacity的“Release”版本
* 產生"DLL Unicode Release"用於 Audacity的“Unicode Release”版本(我用的這個,以支援Unicode編碼)
* 產生"DLL Debug"用於 Audacity的“Debug”版本
* 產生"DLL Unicode Debug"用於 Audacity的“Unicode Debug”版本
見“第六步:編譯Audacity” 瞭解不同版本之間的不同。
如果你是用“產生”菜單下的“批產生”,你只需要選擇下面的5個項目來編譯(不是整個解決方案),它們分別是:
* adv
* base
* core
* html
* net
由於依賴,下面幾個項目也應該會產生:
* wxexpat
* wxjpeg
* wxpng
* wxregex
* wxtiff
* wxzlib
如果你產生的是整個解決方案,忽略編譯時間的串連錯誤(wxbase28*_odbc*.*)
第三步:下載Audacity
現在你可以編譯Audactiy,SVN:http://audacity.sourceforge.net/community/developers
或git:https://github.com/nlphacker/Audacity (我用的這個)
第四步:為Audacity設定wxWidgets位置
Before you can start the build process, you must update the
project settings to tell Visual C++ where to find wxWidgets.
在開始編譯之前,你必須要更新項目設定來告訴Visual C++哪裡能找到wxWidgets. 這裡三個設定是需要改變:
1. Include Directory (e.g., "C:\wxWidgets-2.8.12\include")
2. Resource Directory (e.g., "C:\wxWidgets-2.8.12\include")
3. Library Directory (e.g., "C:\wxWidgets-2.8.12\lib")
我們需要修改系統內容變數來實現,新增環境變數 WXWIN,值為C:\wxWidgets-2.8.12,在Audacity項目種是這樣定義的,如$(WXWIN)\include,設定環境變數後,需要關閉IDE確保環境變數生效,最安全的作法是重啟電腦。
第五步:考慮和配置可選特色
未完待續。。。。