Visual 2008 Express編譯斯坦福第三方C++庫
最近再看斯坦福的抽象程式設計,挺有意思的,但裡面需要用到他們自己編譯的c++第三方庫檔案,所以自己弄了一下。目前大概需要如下檔案:
1.官方提供的是2005的setup檔案(PCLibs-VS2005-ADT-Installer.zip)。
2.visual studio 2008 express,當然更高階也可以,但是這裡express就夠用了,而且安裝檔案不大。
visual studio 2008 express可以到下面兩個連結下載
VS 2008 Express
VS 2008 Express SP1
3. LessMSIerables:一個可以抽取stanford官方msi程式裡面檔案的軟體
好了,這些檔案準備好後就可以開工了,配置和c++安裝第三方庫檔案方法完全一樣,不過stanford提供了第三方庫檔案的工程模板,生成專案更加方便
1.先安裝vs2008 express
2.用LessMSlerables抽取第三方庫檔案
the LessMSIerables(Universal Extractor also works well) in order to extract the contents of the msi file. The msi contains four folders with all the stuff needed to create a new custom wizard. So, the tool extracted the following:
SourceDir |- Includes Folder |- Library Folder |- Project Folder |- Wizard Folder
3.配置第三方庫檔案
- Now some copying:
- The CS106CPPInc folder inside the 'Includes Folder' goes to C:\Program Files\Microsoft Visual Studio 9.0\VC\include (as a subfolder!)
- 'Library Folder'\CS106CPPLib.lib goes to C:\Program Files\Microsoft Visual Studio 9.0\VC\lib
- 'Wizard Folder\AppWiz\CS106 Assignment Wizard' to C:\Program Files\Microsoft Visual Studio 9.0\VC\VCWizards\AppWiz (meaning CS106... should appear as a sub-folder of AppWiz)
- The three files in 'Project Folder' will go into C:\Program Files\Microsoft Visual Studio 9.0\VC\Express\VCProjects\Stanford. One of those three files, the CS106 Assignment Wizard.vsz, needs to be edited (a text file) and its second line should become:
Wizard=VsWizard.VsWizardEngine.9.0 (原來是2005,所以是8,0,這裡要改成9.0)
4.執行vs2008,可以看到stanford工程模板。用他們提供的工程模板寫程式碼就好了。