如何编译Notepad++

转发

Compiling Notepad++

How To Compile Notepad++ From Source


There should be several ways to generate Notepad++ binaries.

The official releases of Notepad++ are generated using Visual Studio 2005.


Contents

Using Visual C++ 2008 Express Edition

Setup

  1. 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).
  2. Run Visual C++ 2008 Express Edition once to set up environment (it is mentioned somewhere in the SDK documentation to do this).
  3. Download and install the Platform SDK whose exact name is "Windows Server 2008".
  4. 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):
    1. In Show directories for -> Executable Files, move $(WindowsSdkDir)\bin up so its above $(VCInstallDir)\bin.
    2. In Show directories for -> Include Files, move $(WindowsSdkDir)\include up so its above $(VCInstallDir)\include.
    3. In Show directories for -> Library Files, move $(WindowsSdkDir)\lib up so its above $(VCInstallDir)\lib.
  5. 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.6.6.src.7z" in the folder "npp 6.6.6 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.
  6. 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.6.6 (win32, Debug)

  1. Within VC++ IDE select Tools -> Visual Studio 2008 command prompt
  2. Change current directory to your\sorce_code\directory\scintilla\boostregex. Don't forget to surround this path with double quotes if it contains spaces.
  3. Now run
BuildBoost.bat --toolset msvc-9.0 your\boost\install\folder

The folder should have the "bin v2" subfolder right below it.

  1. If all goes well, the console informs you of the next two steps:
  2. Change directory to ..\win32
  3. From there, run
nmake -f scintilla.mak"
  1. 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.
  2. Open My Documents\Visual Studio 2008\Projects\npp.6.6.6.src\PowerEditor\visual.net\notepadPlus.vcproj.
    • IMPORTANT: do NOT open notepadPlus.7.0.vcproj, it doesn't build (linker error).
  3. Allow the project upgrade wizard to run with defaults
  4. Select Project -> Build Order and confirm that SciLexer is before notepadPlus in the build order
  5. Build the solution. When prompted save your vc2008 project somewhere (eg My Documents\Visual Studio 2008\Projects\npp.6.6.6.src\PowerEditor\visual.net\SciLexer vc2008). The IDE should build Scintilla first, followed by Notepad++. There should be no errors besides the following:
  6. The result of the Notepad++ build is My Documents\Visual Studio 2008\Projects\npp.6.6.6.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.

  1. Download and unzip the Notepad++ Plugin Demo source code into the folder My Documents\Visual Studio 2008\Projects\NppPluginDemo.
  2. 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.
  3. Save your Visual Studio 2008 project under a new name.
  4. Build the solution.
  5. The result of the plugin build is found in My Documents\Visual Studio 2008\Projects\notepad++\PowerEditor\bin\plugins.
  6. IMPORTANT: Try the Release builds to see if they also work.

A recommended development environment

The following has been posted on Open Discussion Forum and results from interactive setup through the official Notepad++ IRC channel.

  1. Use Visual C++ 2008 EE
  2. Checkout the latest trunk
  3. Open the PowerEditor visual.net notepadPlus.vcproj file
  4. 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.



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Notepad是一个文本编辑器,它可以通过配置来增加编译和运行C语言代码的功能。首先,你需要下载并安装MinGW,然后在Notepad中进行一些配置。你可以在Notepad中写入C代码,并使用快捷键F5来进行编译和运行。具体的配置步骤可以参考引用中的指导。 在配置完成后,你可以按照以下步骤来使用Notepad进行编译和运行C语言代码: 1. 写入C代码,例如: #include<stdio.h> int main() { printf("hello world"); return 0; } 2. 按下F5键来进行宏定义,这会执行编译和运行命令。命令如下: cmd /k gcc -o "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" "$(FULL_CURRENT_PATH)" && CLS && "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" & PAUSE & EXIT 这个命令会将当前打开的源文件编译成可执行文件,并在cmd控制台中运行该可执行文件。你可以通过引用来查看更详细的命令说明。 通过以上步骤,你就可以使用Notepad来编译和运行C语言代码了。这样做可以方便地改变字符编码,并在Ubuntu和Windows系统中都能正常运行代码。请注意,以上步骤是基于使用MinGW作为编译器的前提条件。如果你使用的是其他编译器,则需要相应地进行配置。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [【Notepad++】用 Notepad++ 编译 C/C++](https://blog.csdn.net/chengriyue/article/details/102683512)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [【notepad++notepad++一键编译运行C语言](https://blog.csdn.net/qq_43331089/article/details/125088274)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值