Building Notepad++ with Visual Studio 2015/2017
I would like to join the project so I downloaded the sources and tried following the instructions to build NPP, but failed to so so far.
I have VS 2015 (update 3) and VS 2017 installed on my computer, and I do not have VS 2013 installed. Therefore, the only toolset I have is 14.1. However, the build script (\scintilla\boostregex\BuildBoost.bat) seem to look for toolsets 12.0 and earlier.
I tried modifying the BuildBoost.bat to support msvc-14.1 toolset. Tried building (with boost 1.64). Then I got second problem: Boost builds the module so that its name looks like this: libboost_regex-vc141-mt-1_64.lib, but when I try to compile scintilla using the make file or in visual studio, it says it cannot find libboost_regex-vc140-mt-s-1_64.lib.
I tried renaming the library but it does not do the trick.
Before I spend more time on this: Did anyone try building with VS 2015, where VS 2013 is not around to support toolset 12.0?
I just managed to get it working with boost 1_63_0 / VS 2015 / msvc-14.0 .
C++ and all this linking malarky isn’t my usual poison so I can’t offer expert advice, but I took notes as I went and I’ve uploaded the modified BuildBoost.bat here… https://pastebin.com/VwhkZNQH
VS2015 boost build for notepad++
Using Microsoft Visual Studio Community 2015 Version 14.0.25431.01 Update 3 (most options installed)
Using current boost version 1_63_0 which natively supports VS2015 - https://sourceforge.net/projects/boost/files/boost/1.63.0/
(Older boost versions may need to have visualc.hpp edited as described here - https://stackoverflow.com/questions/30760889/unknown-compiler-version-while-compiling-boost-with-msvc-14-0-vs-2015/)
(NB: b2.exe is exact same as bjam.exe! See - http://www.boost.org/build/doc/html/bbv2/faq/names.html)
Source files downloaded to:
Boost 1_63_0 has bootstrap.bat & b2.exe in ‘…tools\build’ instead of ‘…tools\build\v2’ so minor edit of npp’s BuildBoost.bat required, so created ‘BuildBoost-VS2015edit.bat’ in same folder.
‘BuildBoost-VS2015edit.bat’ also adds case for msvc-14.0 target path since it’s required to auto-generate the scintilla make file.
NB: BuildBoost.bat does not support --toolset since PARAMLOOP code is commented out, so hacked version requires this parameter order:
BuildBoost-VS2015edit.bat PathToBoost [–toolset ToolsetVersion] [-x64]
BuildBoost-VS2015edit.bat C:\Source\boost_1_63_0 --toolset msvc-14.0
Launch ‘Developer Command Prompt for VS2015’ from Start Menu
Launch BuildBoost: (NB: BuildBoost-VS2015edit.bat requires --toolset parameter after path to boost!)
BuildBoost-VS2015edit.bat C:\Source\boost_1_63_0 --toolset msvc-14.0
(boothpath.mak should now have been created containing path to Boost source and also to newly generated Boost regex libs)
nmake -f scintilla.mak
Now should be able to open ‘C:\Source\notepad-plus-plus-master\PowerEditor\visual.net\notepadPlus.vs2015.vcxproj’ and proceed.
NB: There is a certificate check for SciLexer.dll that will fail with newly built version… so I commented out call to VerifySignedLibrary in loadSciLexerDll() function as kindly suggested by dail here… https://notepad-plus-plus.org/community/topic/14054/certificate-required-for-building-notepad
Got it working in VS2017 as well using above instructions with these small changes:
- boost_1_64_0 - has support for VS2017/msvc-14.1 built in
- Small tweak to above mentioned BuildBoost-VS2015edit.bat uploaded as Gist: buildboost-vs2017edit.bat
- I had a clean install of VS2017 Community Edition - but by default some of the SDKs were not installed leading to “cannot find windows.h” type errors. So in the VS2017 installer I had to go to “Individual componets” tab and install some SDKs… I think the only one required extra was “Windows XP support for C++” but possibly also “Windows 8.1 SDK”
Got it working in VS 2017 + boost_1_65_1 + msvc-14.1 using moon6969’s buildboost-vs2017edit.bat
On VS 2017 Community Edition I had to install Windows XP Support for C++ and Windows Universal CRT SDK in order to correct the “cannot find…” errors.
I had some Compiler Errors C2220 as well, then had to bypass the /MX option (which tells the compiler to treat all warnings as error).
I made some mods to my version of buildboost2017.bat, which is based on moon6969’s buildboost-vs2017.bat. Mine now auto-detects the VS tool version for VS2015/VS2017 and handles command-line args in any order.
I just used it to build boost_1_65_1 with VS2017 by entering:
Loaded the VS2017 project, changed the build from x64 to x86, and built it.
After successful build, copied .\scintilla\bin\SciLexer.dll to .\PowerEditor\visual.net\Unicode Debug.
Then ran .\PowerEditor\visual.net\Unicode Debug\notepad++ successfully!
Note that boost_1_66_0 does not seem to build correctly, but 1_65_1 builds just fine.
There were already some PRs on this, not integrated by donho:
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’
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.