Monthly Archives: July 2014

Visual Studio Annoyances

This thing could not be more irritating to use.

  • Fatal Error C1902: Program database manager mismatch; please check your installation

    Something to do with debugging. Ignore the lies and rubbish written about mspdb80.dll, just ensure that you are not compiling with “/Zi”. Change Properties -> Configuration Properties -> C/C++ -> General -> Debug Information Format to “C7 compatible”.

  • OpenMP with Visual Studio 2010 Express

    So, although the CL compiler that ships with VS2010 Express supports OpenMP, this feature’s disabled because some files are missing. Specifically:

    • omp.h Although not redistributable, it can be found on github
    • vcomp100.dllInstall the VS 2010 Redistributables
    • vcomp.lib Can be made from the vcomp100.dll. Do:
      dumpbin.exe /exports vcomp100.dll > vcomp
      

      From vcomp, extract the symbol names, and stick them in another file, along with a simple header, viz:

      LIBRARY VCOMP100.DLL
      EXPORTS
      _vcomp_atomic_add_i1
      _vcomp_atomic_add_i2
      ...
      

      Finally make the import library.

      lib.exe /def:vcomp /out:vcomp.lib
      

      Then copy that into Visual Studio’s VC/lib directory

  • But wait! There’s more. Microsoft’s shipped vcomp.lib also includes a magic symbol. Somewhere in your source, you’ll need to add
    extern "C" void _You_must_link_with_Microsoft_OpenMP_library( void ) {}