There should be several ways to generate Notepad++ binaries.
The official releases of Notepad++ are generated using Visual Studio 2005.
Using Visual C++ 2008 Express Edition
- Download and install Visual C++ 2008 Express Edition. There are 3 components; it is only necessary to install the first (IDE) and not the other two (MSDN and Database).
- Run Visual C++ 2008 Express Edition once to set up environment (it is mentioned somewhere in the SDK documentation to do this).
- Download and install the Platform SDK whose exact name is "Windows Server 2008".
- Start Visual C++ 2008 Express Edition again, go to Tools -> Options -> Projects and Solutions -> VC++ Directories, and do these three steps (using the 'arrow up' button):
- In Show directories for -> Executable Files, move $(WindowsSdkDir)\bin up so its above $(VCInstallDir)\bin.
- In Show directories for -> Include Files, move $(WindowsSdkDir)\include up so its above $(VCInstallDir)\include.
- In Show directories for -> Library Files, move $(WindowsSdkDir)\lib up so its above $(VCInstallDir)\lib.
- Download the Notepad++ source code. There are several ways to do this. Select one of the following methods:
- Either check out the source code directly from Subversion; the repository URL is svn://svn.tuxfamily.org/svnroot/notepadplus/repository. You can use TortoiseSVN or any other SVN client to check it out. Check it out into your My Documents\Visual Studio 2008\Projects\ folder.
- Or download a GNU tarball of the latest source code from the Subversion web interface. Unpack the tarball to a new folder in your My Documents\Visual Studio 2008\Projects\ folder.
- Or download the zip file "npp.6.3.2.src.7z" in the folder "npp 6.3.2 src" that should exist in the "notepad++ releases source" folder at Sourceforge. At the time of writing this, though, the zip file of the latest version was not available. But if it is, download it and unzip it as a new folder in your My Documents\Visual Studio 2008\Projects\ folder.
- Download the latest Boost library from http://www.boost.org/users/download/ and unzip in a hard disk of your choice. The archive only contains one folder with a lush sbtree under it.
Build Notepad++ v6.3.2 (win32, Debug)
- Within VC++ IDE select Tools -> Visual Studio 2008 command prompt
- Change current directory to your\sorce_code\directory\scintilla\boostregex. Don't forget to surround this path with double quotes if it contains spaces.
- Now run
BuildBoost.bat --toolset msvc-9.0 your\boost\install\folder
The folder should have the "bin v2" subfolder right below it.
- If all goes well, the console informs you of the next two steps:
- Change directory to ..\win32
- From there, run
nmake -f scintilla.mak"
- At this point you have a SciLexer.dll ready in ..\bin, with full regula expression support. You can safely ignore the harmless warnings about unused local functions. Copy it where your executable should be created - it needs it.
- Open My Documents\Visual Studio 2008\Projects\npp.6.3.2.src\PowerEditor\visual.net\notepadPlus.vcproj.
- IMPORTANT: do NOT open notepadPlus.7.0.vcproj, it doesn't build (linker error).
- Allow the project upgrade wizard to run with defaults
- Select Project -> Build Order and confirm that SciLexer is before notepadPlus in the build order
- Build the solution. When prompted save your vc2008 project somewhere (eg My Documents\Visual Studio 2008\Projects\npp.6.3.2.src\PowerEditor\visual.net\SciLexer vc2008). The IDE should build Scintilla first, followed by Notepad++. There should be no errors besides the following:
- The result of the Notepad++ build is My Documents\Visual Studio 2008\Projects\npp.6.3.2.src\PowerEditor\visual.net\Debug\Notepad++.exe. You must have copied SciLexer.dll there. Otherwise, Notepad++ might try an older dll with unpredictable results.
How to build a sample plugin (NppPluginDemo)
This is how to build a sample plugin. Note that building a plugin is not necessary if you just want to compile Notepad++ itself.
- Download and unzip the Notepad++ Plugin Demo source code into the folder My Documents\Visual Studio 2008\Projects\NppPluginDemo.
- Within Visual Studio 2008 select File -> Open -> Project/Solution and open the project My Documents\Visual Studio 2008\Projects\NppPluginDemo\NppPluginDemo.vcproj; allow the project upgrade wizard to run with defaults.
- Save your Visual Studio 2008 project under a new name.
- Build the solution.
- The result of the plugin build is found in My Documents\Visual Studio 2008\Projects\notepad++\PowerEditor\bin\plugins.
- IMPORTANT: Try the Release builds to see if they also work.
A recommended development environment
- Use Visual C++ 2008 EE
- Checkout the latest trunk
- Open the PowerEditor visual.net notepadPlus.vcproj file
- Add dependency to PowerEditor (it should depend on SciLexer).
Using Visual C++ 2010 Express Edition
See the article How to build Notepad++ with Visual C++ 2010 Express?.
Fixing or enhancing Notepad++
So you modified the code, and that has fixed a bug, enhanced or added some functionality?
Then the usual rules about open source code apply:
- thoroughly test that you don't cause regressions, ie break something that previously worked. If at all possible, ask non programmers to test. They are pretty good at hitting gaping faults we don't see.
- Incorrectly commented code is bad code. You have no idea of whoever will maintain your code, neither when nor why. No one else does anyway.
Brilliant and perfect? Then you can contact the main developer about it. Make a patch to apply your mods to the latest revision on SVN, and submit it at https://sourceforge.net/tracker/?group_id=95717&atid=612384
You may want to read this thread: How do I join the development team?.
And the story ends here, they lived happy and had lots of lines of code.