Building Notepad++ with Visual Studio 2015/2017



  • There were already some PRs on this, not integrated by donho:
    https://github.com/notepad-plus-plus/notepad-plus-plus/pull/2336
    https://github.com/notepad-plus-plus/notepad-plus-plus/pull/2062

    There is also a visual studio project using nuget for boost, which could be used, see https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/scintilla/win32/SciLexer.vcxproj. But that is still at VS2013.



  • @donho what kind of PR would you accept on this? At least a update for vs2015 seems meaningfull to me.



  • I have been trying endlessly for 1 day now and felt i needed to ask for help.
    I tried to follow first the 2015 version and then the 2017. After getting many different times install errors, and trying to update visual studio to different packages like a mad dog, i ended up with this.

    LINK : fatal error LNK1104: cannot open file ‘…\bin\Scintilla.dll’
    NMAKE : fatal error U1077: ‘“C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX86\x86\link.EXE”’ : return code ‘0x450’
    Stop.

    This was the 2017 version with the bat script supplied above.
    I have no idea how to proceed, any tips. What have i overlooked



  • I solved it, now i am trying to solve the build order and how to include it in the right place.
    The solution was obvious i accidentally removed the bin directory, the one in the root directory.



  • The final thing was changing the project to 86 instead of 64. So basically Gary Blooms version works fine for me

    And you may ask why did i do 3 posts and not edit 1? Well for some reason this site don’t allow you to edit your post after 180 seconds, which is weird but hey when in rome.



  • Greetings! I am trying to build Notepad++ with Visual Studio 2017, but I’m having some difficulties. I’m following Gary Bloom’s plan and I’ve gotten as far as changing the build from x64 to x86 without any problems. However, when I try to build it, I get the following error message:

    fatal error C1083: Cannot open include file: ‘atlbase.h’: No such file or directory

    I have confirmed that both “Visual C++ ATL Support” and “MFC and ATL Support (x86 and x64)” are installed, but the issue persists. Any advice?



  • Ah, I’ve gotten it to build. I needed to switch the project from the 2015 toolset to the 2017 toolset.



  • Build notes from NPP v7.6.3

    Use Boost 1_65_1 to build scintilla.dll

    First looked at using latest Boost 1_69_0, but failed.
    Since Boost 1_66_0, the Boost lib file name structure now has extra “x32” detail:
    libboost_regex-vc141-mt-s-1_65_1.lib
    vs
    libboost_regex-vc141-mt-s-x32-1_66.lib

    This causes issue in BuildBoost.bat since it can’t autodetect the library file.
    This can be worked around using --toolset msvc-14.1, but then scintilla.mak fails with some architecture related error from Boost source…
    boost_1_69_0\boost/type_traits/detail/is_function_cxx_11.hpp(111): error C2218: '__vectorcall' cannot be used with '/arch:IA32'

    So I just continued using Boost 1_65_1 (and Gary Bloom’s above buildboost2017.bat).

    Build notepadPlus.vcxproj in VS2017

    • Copied scintilla\bin\SciLexer.dll to PowerEditor\visual.net\Unicode Debug\
    • When opening notepad-plus-plus-7.6.3\PowerEditor\visual.net\notepadPlus.vcxproj the first time, I was prompted by VS to “Retarget Projects” to v141_xp.
    • Changed the VS “Solution Platform” from x64 to x86


  • Build notes for NPP v7.8.2 32bit with Visual Studio 2017 on Win10

    Build process on NPP’s github has been updated to no longer include requirement for BuildBoost*.bat. It worked pretty smoothly, except for minor difference with boost_1_72_0 compared to boost_1_70_0.

    Use Boost 1_72_0 to build SciLexer.dll

    • Download boost_1_72_0 from https://www.boost.org/
    • Open “Visual Studio 2017 Developer Command Prompt”
    • cd <base>\boost_1_72_0\
    • bootstrap.bat
    • cd <base>\boost_1_72_0\libs\regex\build
    • <base>\boost_1_70_2\b2.exe toolset=msvc link=static threading=multi runtime-link=static release stage
    • Copy libboost_regex-vc141-mt-s-x32-1_72.lib to <base>\boost.tmp\
      NB: Contrary to github guide (step 4), I found libboost_regex-vc141-mt-s-x32-1_72.lib in:
      <base>\boost_1_72_0\stage\lib\ .
    • cd <base>\notepad-plus-plus-7.8.2\scintilla\win32\
    • nmake BOOSTPATH=<base>\boost_1_72_0\ BOOSTREGEXLIBPATH=<base>\boost.tmp\ -f scintilla.mak
    • Copy <base>\notepad-plus-plus-7.8.2\scintilla\bin\SciLexer.dll
      to <base>\notepad-plus-plus-7.8.2\PowerEditor\visual.net\Unicode Debug\
    • Open <base>\notepad-plus-plus-7.8.2\PowerEditor\visual.net\notepadPlus.vcxproj in VS2017
    • Change configuration to x86
    • Build & enjoy

    NB: If debugging NPP from within VS, enable Multi-instance in NPP settings or close other instances of notepad++.exe



  • @moon6969 said in Building Notepad++ with Visual Studio 2015/2017:

    NB: If debugging NPP from within VS, enable Multi-instance in NPP settings

    Or…what I do is add it to the VS properties like so (shown for VS2019):

    51c31c91-a44d-45f4-a33b-8b5ee03fc37b-image.png



  • Build successfull on newly installed Visual Studio 2019 Community Edition. I followed the above v7.8.2 notes.

    On opening notepadPlus.vcxproj, I accepted prompt in VS2019 to upgrade SDK to v10 and Platform Toolset to v142.

    On first build, there is a new C++ warning…
    C4834: discarding return value of function with 'nodiscard' attribute

    VS2019 was treating it as an error, so I added /Wv:19.10 compiler option (to use an earlier C++ versions warnings)…
    Notepad++CompilerWarningSettings.png



  • @moon6969 said in Building Notepad++ with Visual Studio 2015/2017:

    On first build, there is a new C++ warning…
    C4834: discarding return value of function with 'nodiscard' attribute

    Disclaimer: I’ve no idea what this warning means or the impact of ignoring it… but it seems to work :)



  • @moon6969

    not that I understand what they are talking about here.



  • @moon6969

    so I added /Wv:19.10 compiler option

    Where did you get the idea to use that exact number?

    (I just turn off “treat warnings as errors” instead when I have built the source code)



  • @Alan-Kilborn

    the C4834 link directs to this warning setting.



  • @Ekopalypse

    Ah, never knew that. Presume one could also use 19.10.25017.0 in this case.


Log in to reply