3.5 KiB
How to build Notepad++
Pre-requisites:
- Microsoft Visual Studio 2017 (C/C++ Compiler, v141 toolset for win32, x64, arm64)
There are two components which are built from one visual studio solution:
notepad++.exe
: (containslibSciLexer.lib
)libSciLexer.lib
: static library based on Scintilla
Notepad++ is always built with Boost regex PCRE support instead of default c++11 regex ECMAScript used by plain Scintilla\SciLexer.
Build notepad++.exe
:
- Open
PowerEditor\visual.net\notepadPlus.sln
- Select a solution configuration (Unicode Debug or Unicode Release) and a solution platform (x64 or Win32 or ARM64)
- Build Notepad++ solution like a normal Visual Studio project. This will also build the dependent SciLexer project.
Build libSciLexer.lib
:
As mentioned above, you'll need libSciLexer.lib
for the Notepad++ build. This is done automatically on building the whole solution. So normally you don't need to care about this.
Build libSciLexer.lib
with boost via nmake:
This is not necessary any more and just here for completeness as this option is still available. Boost is taken from boost 1.76.0 and stripped down to the project needs available at boost in this repo.
- Open the Developer Command Prompt for Visual Studio
- Go into the
scintilla\win32\
- Build the same configuration as notepad++:
- Release:
nmake -f scintilla.mak
- Debug:
nmake DEBUG=1 -f scintilla.mak
- Example:
nmake -f scintilla.mak
- Release:
History:
More about the previous build process: https://community.notepad-plus-plus.org/topic/13959/building-notepad-with-visual-studio-2015-2017
Since Notepad++
version 6.0 - 7.9.5, the build of dynamic linked SciLexer.dll
that is distributed
uses features from Boost's Boost.Regex
library.
Build 64 bits binaries with GCC:
If you have installed MinGW-w64, then you can compile Notepad++ & libscilexer.a 64 bits binaries with GCC.
- Compile libscilexer.a
- Launch cmd.
- Change dir into
notepad-plus-plus\scintilla\win32
. - Type
mingw32-make.exe -j%NUMBER_OF_PROCESSORS%
libscilexer.a
is generated innotepad-plus-plus\scintilla\bin\
.
- Compile Notepad++ binary
- Launch cmd.
- Change dir into
notepad-plus-plus\PowerEditor\gcc
. - Type
mingw32-make.exe -j%NUMBER_OF_PROCESSORS%
NotepadPP.exe
is generated innotepad-plus-plus\PowerEditor\bin\
.
You can download MinGW-w64 from https://sourceforge.net/projects/mingw-w64/files/. On Notepad++ Github page (this project), the build system use MinGW 8.1.
Note 1: if you use MinGW from the package (7z), you need manually add the MinGW/bin folder path to system Path variable to make mingw32-make.exe invoke works (or you can use command :set PATH=%PATH%;C:\xxxx\mingw64\bin
for adding it on each time you launch cmd).
Note 2: For 32-bit build, https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/threads-posix/sjlj/i686-8.1.0-release-posix-sjlj-rt_v6-rev0.7z could be used. The rest of the instructions are still valid.