1. 程式人生 > >Visual 2008 Express編譯斯坦福第三方C++庫

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

http://download.microsoft.com/download/8/B/5/8B5804AD-4990-40D0-A6AA-CE894CBBB3DC/VS2008ExpressENUX1397868.iso

VS 2008 Express SP1

http://download.microsoft.com/download/E/8/E/E8EEB394-7F42-4963-A2D8-29559B738298/VS2008ExpressWithSP1ENUX1504728.iso

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:
    1. The CS106CPPInc folder inside the 'Includes Folder' goes to C:\Program Files\Microsoft Visual Studio 9.0\VC\include (as a subfolder!)
    2. 'Library Folder'\CS106CPPLib.lib goes to C:\Program Files\Microsoft Visual Studio 9.0\VC\lib
    3. '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)
    4. 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工程模板。用他們提供的工程模板寫程式碼就好了。