4.8 KiB
Building Notepad++
Microsoft Visual Studio
Pre-requisites:
- Microsoft Visual Studio 2022 version 17.5 (C/C++ Compiler, v143 toolset for win32, x64, arm64)
There are three components which are built from one visual studio solution:
notepad++.exe
: (containslibSciLexer.lib
)libScintilla.lib
: static library based on ScintillalibLexilla.lib
: static library based on Lexilla
Notepad++ is always built with Boost regex PCRE support instead of default c++11 regex ECMAScript used by plain Scintilla.
Build notepad++.exe
- Open
PowerEditor\visual.net\notepadPlus.sln
- Select a solution configuration (Debug or 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 Scintilla and Lexilla projects.
Build libScintilla.lib
and libLexilla.lib
As mentioned above, you'll need libScintilla.lib
and libLexilla.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 libScintilla.lib
with boost and libLexilla.lib
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.85.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:
- Go into the
lexilla\src\
- Build the same configuration as notepad++:
- Release:
nmake -f lexilla.mak
- Debug:
nmake DEBUG=1 -f lexilla.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.
GCC
If you have MinGW-w64 installed, you can compile Notepad++ with GCC. Otherwise MinGW-w64 can be downloaded here. You can also download some collection of tools which supports MinGW-w64, like MSYS2 or WinLibs.
Building Notepad++ is regularly tested on a Windows system by using MSYS2 project. Current versions of tools used to building (such as GCC, Make or Bash) can be checked by looking at some logs from the finished building (for example in the current-build page). Other versions may also work but are untested.
Note: Before building make sure that the system PATH
environment variable contains $MinGW-root$\bin
directory. Otherwise you have to set this directory yourself in Windows settings. You can also use a command like set PATH=$MinGW-root$\bin;%PATH%
each time cmd
is launched. But beware that if PATH
contains several versions of MinGW-w64 GCC, only the first one will be usable.
Compiling Notepad++ binary
- Launch
cmd
and add$MinGW-root$\bin
toPATH
if necessary. cd
intonotepad-plus-plus\PowerEditor\gcc
.- Run
mingw32-make
. - The 32-bit or 64-bit
notepad++.exe
will be generated either inbin.i686
or inbin.x86_64
directory respectively, depending on the target CPU of the compiler — look for the full path to the resulting binary at the end of the build process.
Some additional information
- The directory containing
notepad++.exe
will also contain everything needed for Notepad++ to start. - To have a debug build just add
DEBUG=1
to themingw32-make
invocation above. The output directory then will be suffixed with-debug
. - To see commands being executed add
VERBOSE=1
to the same command. - When a project is built outside of the
PowerEditor/gcc
directory, for example when using-f
option, then the entire project path must not contain any spaces. Additionally, the path tomakefile
of this project should be listed as first. - When a project is built through MinGW-w64 with multilib support, a specific target can be forced by passing
TARGET_CPU
variable withx86_64
ori686
as value.