Thursday, May 13, 2010

Stanford CS106 Lib and VS2008 Express

The CS106B is a great CS Stanford course available online (iTunes e.g.) in video and for free. All assignments and the course itself use an in-house developed library (not sure if it has a name, cslib, cs106 lib, dunno) available in all of the assignment zips as well as installable with the Xcode/VS2005 wizard installs. The problem - the VS custom wizard will install on VS2005 only (could be that a newer version exists but I couldn't find one). So how to port the VS wizard to VS2008 Express?
- I got the 2005 custom wizard setup, PCLibs-VS2005-ADT-Installer.zip and used a small tool , the LessMSIerables 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

- 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

You should now have a new group in the VS project wizard list, Stanford plus one item in that group (our project wizard).
Problem: you will get some warning LNK4204 when linking (complaining about missing vc80.pdb), I don't think we could do anything about those (even if we change the pdb file name to vc80.pdb), suggestions on this one highly appreciated!

13 comments:

  1. Don't have "C:\Program Files\Microsoft Visual Studio 9.0\VC\Express\VCProjects\", but I have

    "C:\Program Files\Microsoft Visual Studio 9.0\VC\VCProjects\", it worked as well. Thanks so much!

    ReplyDelete
  2. you might be interested in
    http://www.stanford.edu/class/cs106b/
    which is very similar and comes with vs2008 ready files :)

    ReplyDelete
  3. thanks, it really works well and has been examined by cs106b 2010 assignment1

    ReplyDelete
  4. hey Dealga, thanks for the update, its just that at the time of my writing the Express was not supported..

    ReplyDelete
  5. I am using windows 7 and VS 2005 ( I install both of recommented service packs 1 . I cannot install the library for CS106 course on my PC. I do as the instruction, but after extract .MSI file by LessMSIerables, I get only one folder.
    Please give me some advice.
    Truly appreciate.

    ReplyDelete
  6. Maybe you could try the blank project? http://www.stanford.edu/class/cs106b/materials/blank-pc-project.zip

    ReplyDelete
  7. This is good stuff. But I had no idea that the newer CS106B files supported VS2008 Express.

    ReplyDelete
  8. after a lot of wondering around finally i found out about your blog... This has been such a pain that i can't get over the simple fact i was not able to run a compiler jsut to compiler some code. you have been a life saver. though i agree there is a new version available and other stuff but to the examples on the code it was nice............

    Many thanks to you man

    ReplyDelete
  9. Any advice to get this to work in VS C++ 2010 Express? I am able to get the new project wizard, but VS program crashes after the name your project step.

    ReplyDelete
  10. Hello Dani, I did everything you mention, but I get an error whenever I choose the Stanford Wizard:

    In the lower part there's this message being displayed: "Creating project Blank...Project creation failed." Did you ever encounter this problem? Thanks for sharing this workaround!

    ReplyDelete