Newer Boost and Visual Studio

  • cchris

    cchris - 2014-02-12

    Hi all,

    I recently installed Visual Studio Express and managed to compile Scintilla and Notepad++. However, some small tweaks were in order:

    1/ The current BuildBoost.bat does not support VS2012 nor 2013. Support is fairly easy to add: simply locare the two places where msvc- versions are mentioned, and create two more versions at each place. Adapting from the existing code is straightforward.

    2/ Depending on your current version of Boost, it may not support the newest compilers. Upgrading to latest (v1.55.0) doesn't harm at all. Older versions of Boost can be tweaked, because they don't do anything specific about Visual C++ versions besides checking the version, but upgrading is healthier and painless.

    3/ VS2013 command prompt is not as easily available as under VS2012, at least under Windows 8. Looking for Visual Studio Tools will do the trick. I followed their advice of pining the prompt to the pin bar.

    4/ Now there are two glitches compiling Notepad++
    a/ GetVersionx is deprecated, because Microsoft plans not to care about Win2K and earlier;
    EDIT: after compiling all uses for the current OS version in code, there are basically two use cases:
    UAC related matters, for which the newer M$ API is straightforward to use
    Support for aging versions, specifically the need to tell Win2K from NT4 boxes. Would raising the compatibility bar to Win2K hurt? If not, then the modern API is good enough as well.
    b/ There is an INFINITY maro in the SDK incompatible with the one defined in WinMgr.h
    EDIT: this macro duplicates SHRT_MAX in the standard limits.h header, so let's use it instead.


    Last edit: cchris 2014-02-19
  • Mike Cowperthwaite

    NP 6.6.9, Boost 1.56.0, VSExpress 2013, Windows 7

    1) Not sure when this changed, but Boost no longer uses the v2 subdirectory of tools\build, so BoostBuild.bat fails if the bjam tool has not already been built. Just editing the two command lines in that batch file to remove \v2 from the path lets this work. And of course with VSX2013, you need to use

    buildboost.bat --toolset msvc-12 <boost-root>

    2) On letting VSExpress convert the .VCPROJ to a .VCXPROJ, the "precompiled headers" settings are incorrect; not sure if this error is from the original file or not, but the entire project is set to "create" the .PCH file. This is wrong. The entire project should be set to "use" the .PCH file (in both Debug and Release configs), and precompiledheaders.cpp alone should have "create" set to override this. Builds a lot faster when this is fixed.

    3) The VCXPROJ file also sets the /WX (warnings are errors) flag; again, not sure if that is in the original project file or a result of the conversion. But it does cause the build to fail on the GetVersionEx() calls. To work around this, I simply tweaked Parameters.cpp to use

    #pragma warning(push)
    #pragma warning(disable:4996)

    before, and

    #pragma warning(pop)

    after the block with the two calls.

    4) The output directory for the Notepad EXEs is not PowerEditor\bin; I think that setting must have gotten lost in the conversion. The EXEs get placed into
    PowerEditor\\Unicode Release (or Unicode Debug).
    I think Microsoft has been moving in the direction of using different folders for release and debug, rather than different names for the output (e.g. NotepadPlus_Debug.exe).


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks