{"id":516,"date":"2014-04-21T20:56:48","date_gmt":"2014-04-21T12:56:48","guid":{"rendered":"http:\/\/blog.nami.idv.tw\/?p=516"},"modified":"2019-07-11T18:43:15","modified_gmt":"2019-07-11T10:43:15","slug":"how-to-compile-notepad-using-visual-studio-2010","status":"publish","type":"post","link":"https:\/\/blog.nami.idv.tw\/?p=516","title":{"rendered":"How To Compile Notepad++ Using Visual Studio 2010"},"content":{"rendered":"<p>\u5982\u4f55\u7528 Visual Studio 2010 \u7de8\u8b6f Notepad++ \u539f\u59cb\u78bc<\/p>\n<p>\u4e00\u3001\u4e0b\u8f09 Notepad++ source code<\/p>\n<p>Notepad++\u5b98\u7db2\uff1a <a href=\"http:\/\/notepad-plus-plus.org\/\" rel=\"nofollow\">http:\/\/notepad-plus-plus.org<\/a><\/p>\n<p>\u53ef\u4ee5\u4f7f\u7528 svn check out \u539f\u59cb\u78bc\u76f4\u63a5\u4e0b\u8f09\u7576\u524d\u6700\u65b0\u7684 trunk \u6216\u662f\u76f4\u63a5\u4e0b\u8f09 released \u7684\u6574\u5305\u539f\u59cb\u78bc\u3002<\/p>\n<p>SVN Repository\uff1asvn:\/\/svn.tuxfamily.org\/svnroot\/notepadplus\/repository\/trunk<br \/>\n\u76f4\u63a5\u770b trunk \u5167\u5bb9\uff1ahttp:\/\/svn.tuxfamily.org\/notepadplus\/repository\/trunk\/<br \/>\n\u6574\u5305\uff1ahttp:\/\/download.tuxfamily.org\/notepadplus\/6.5.5\/npp.6.5.5.src.7z<\/p>\n<p>\u539f\u59cb\u78bc\u88e1\u9762\u6709\u5169\u500b\u76ee\u9304\uff1a<\/p>\n<pre class=\"brush: plain; ruler: true;\">..\\PowerEditor\n..\\scintilla<\/pre>\n<p>\u53ca\u4e00\u500b\u8aaa\u660e\u6587\u4ef6 readmeFirst.txt \u6587\u4ef6\uff0c\u8a72\u6587\u4ef6\u5c31\u662f\u7de8\u8b6f\u6b65\u9a5f\u8aaa\u660e\uff0c\u57fa\u672c\u4e0a\u7167\u8457\u88e1\u9762\u7684\u8aaa\u660e\u9032\u884c\u5373\u53ef\u3002<\/p>\n<p>\u5148\u5c07\u539f\u59cb\u78bc\u6a94\u6848\u89e3\u58d3\uff08\u6216\u4e0b\u8f09\uff09\u5230\u4e00\u500b<strong>\u8def\u5f91\u6c92\u6709\u7a7a\u767d\u5b57\u5143\u53ca\u975eASCII\u5b57\u5143\u7684\u8def\u5f91\u88e1<\/strong>\u3002<\/p>\n<p>\u4e8c\u3001\u7de8\u8b6f Scintilla<\/p>\n<p>\u56e0\u70baNotepad++\u662f\u57fa\u65bc Scintilla <a href=\"http:\/\/www.scintilla.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.scintilla.org\/<\/a> \u958b\u767c\u7684\uff0c\u6240\u4ee5\u9700\u8981\u5148\u7de8\u8b6fScintilla\u3002<\/p>\n<p>Scintilla \u7de8\u8b6f\u7684\u90e8\u5206\u6703\u5206\u70ba\u5169\u7a2e\u60c5\u6cc1\uff0c\u5dee\u5225\u5728\u65bc\u662f\u5426\u5305\u542b Boost\u3002<\/p>\n<p>\u56e0\u70ba SciLexer.dll\uff08\u7de8\u8b6f Scintilla \u5f8c\u7522\u751f\u7684\u52d5\u614b\u93c8\u7d50\u51fd\u5f0f\u5eab\uff09\u5f9e Notepad++ 6.0 \u4ee5\u5f8c\u767c\u5e03\u7684\u7248\u672c\u5305\u62ec\u4e86 Boost \u7684 PCRE (Perl Compatible Regular Expressions) \u7a0b\u5f0f\u5eab\uff0cPCRE \u662f\u4e00\u500bPerl \u51fd\u5f0f\u5eab\uff0c\u5305\u62ec Perl \u76f8\u5bb9\u7684\u6b63\u898f\u8868\u793a\u5f0f\u51fd\u5f0f\u5eab\uff0c\u6240\u4ee5\u7de8\u8b6f Scintilla \u9700\u8981 Boost \u7684\u652f\u63f4\u3002\u5982\u679c\u4e0d\u5305\u542b Boost\uff0c\u5247\u7de8\u8b6f Scintilla \u6642\u9810\u8a2d\u4f7f\u7528 POSIX \u9019\u500b\u6b63\u898f\u8868\u793a\u5f0f\u51fd\u5f0f\u5eab\u4f86\u4ee3\u66ffPCRE\uff0c\u9019\u6a23\u4e5f\u80fd\u6b63\u5e38\u7de8\u8b6f\u57f7\u884c Notepad++\uff0c\u4f46\u662f\u53ef\u80fd\u6703\u5c0e\u81f4\u90e8\u5206\u529f\u80fd\u4e0d\u6b63\u5e38\u3002<\/p>\n<p>\u9019\u88e1\u53ef\u4ee5\u6839\u64da\u81ea\u5df1\u7684\u9700\u8981\u9032\u884c\u6289\u64c7\uff0c\u7b46\u8005\u5efa\u8b70\u63a1\u7528 Perl \u7684 RegExp \u6703\u6bd4\u8f03\u597d\u3002<\/p>\n<ol>\n<li>\u63a1\u7528 Boost \u7684\u7de8\u8b6f\u6b65\u9a5f\n<ol>\n<li>\u5230 Boost \u5b98\u65b9\u7db2\u7ad9 <a href=\"http:\/\/www.boost.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.boost.org\/<\/a> \u4e0b\u8f09\u51fd\u5f0f\u5eab\u5305<\/li>\n<li>\u89e3\u58d3\u5230\u4e00\u500b<strong><strong>\u8def\u5f91\u6c92\u6709\u7a7a\u767d\u5b57\u5143\u53ca\u975eASCII\u5b57\u5143<\/strong>\u7684\u8def\u5f91\u88e1<\/strong><\/li>\n<li>\u4ee5 <strong>Visual Studio 2010 \u7684\u547d\u4ee4\u5217\u5de5\u5177<\/strong>\uff0c\u9032\u5165 \\scintilla\\ \u76ee\u9304<br \/>\n\uff08\u5728 \u7a0b\u5f0f\u96c6 &gt; Microsoft Visual Studio 2010 &gt; Visual Studio Tools &gt;Visual Studio \u547d\u4ee4\u63d0\u793a\u5b57\u5143 (2010)\uff0c\u9019\u9ede\u76f8\u7576\u91cd\u8981\uff0c\u56e0\u70ba VS2010 \u7684\u547d\u4ee4\u5217\u5de5\u5177\u6703\u5e36\u5165\u6240\u6709\u57f7\u884c\u74b0\u5883\u8b8a\u6578\uff0c\u624d\u80fd\u8b93\u63a5\u4e0b\u4f86\u7684 make \u4f5c\u696d\u6b63\u5e38\u57f7\u884c\uff0c\u5225\u50cf\u7b46\u8005\u76f4\u63a5 cmd \u53bb\u8dd1\uff0c\u649e\u5230\u4e00\u5806\u932f\u8aa4...\uff09<\/li>\n<li>\u9032\u5165 \\scintilla\\boostregex\\ \u76ee\u9304\u4e0b\u57f7\u884c BuildBoost.bat\uff0c\u53c3\u6578\u70ba Boost \u653e\u7f6e\u7684\u8def\u5f91\uff0c\u4f8b\u5982\uff1aBuildBoost.bat E:\\Lib\\boost_1_55_0\uff0c\u6216\u662f\u4e5f\u53ef\u4ee5\u9078\u64c7\u6027\u52a0\u4e0a --toolset msvc-10.0 \u53c3\u6578\u8868\u793a\u7528 VS2010 \u7684\u7248\u672c\u53bb\u7de8\u8b6f<\/li>\n<li>\u4ee5\u4e0a\u5b8c\u6210\u5f8c\uff0c\u5230 \\scintilla\\win32\\ \u76ee\u9304\u57f7\u884c nmake -f scintilla.mak<\/li>\n<\/ol>\n<\/li>\n<li>\u4e0d\u63a1\u7528 Boost \u7684\u7de8\u8b6f\u6b65\u9a5f\n<ol>\n<li>\u9032\u5165 \\scintilla\\win32\\ \u76ee\u9304\u4e0b\u57f7\u884c nmake NOBOOST=1 -f scintilla.mak<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>\u7de8\u8b6f\u6210\u529f\u4e4b\u5f8c\u5728 \\scintilla\\bin \u76ee\u9304\u4e0b\u6703\u770b\u5230\u5169\u500b DLL \u6a94\u6848\uff0c\u5206\u5225\u70ba Scintilla.dll\u3001SciLexer.dll\uff0c\u9019\u7b49\u4e00\u4e0b\u8981\u642c\u5230 Notepad++ \u7de8\u8b6f\u5f8c\u7684 bin \u76ee\u9304\u88e1\u3002<\/p>\n<p>\u4e09\u3001\u7de8\u8b6f Notepad++<\/p>\n<p>\u7528 Visual Studio \u958b\u555f \\PowerEditor\\visual.net \u76ee\u9304\u88e1\u7684\u5c08\u6848\u6a94\u6848\uff0c\u4e26\u8b93\u5b83\u5f9e VS2005 \u5347\u7d1a\u5230 VS2010 \u7684\u6a94\u6848\u683c\u5f0f\uff0c\u63a5\u4e0b\u4f86\u8acb\u4f9d\u7167 Notepad++ Wiki \u88e1\u6240\u8ff0\uff1a<\/p>\n<p><i>\u5c08\u6848 -&gt; \u5c6c\u6027 -&gt; VC++ \u76ee\u9304<\/i>\uff0c\u8b8a\u66f4\u4ee5\u4e0b\u4e09\u500b\u641c\u5c0b\u9806\u5e8f\uff0c\u5c07 <b>$(WindowsSdkDir)<\/b> \u7684\u79fb\u5230 <b>$(VCInstallDir)<\/b> \u524d\u9762<\/p>\n<ol>\n<li>In Show directories for -&gt; <b>Executable Files<\/b>, move <b>$(WindowsSdkDir)\\bin<\/b> up so its above <b>$(VCInstallDir)\\bin<\/b>.<\/li>\n<li>In Show directories for -&gt; <b>Include Files<\/b>, move <b>$(WindowsSdkDir)\\include<\/b> up so its above <b>$(VCInstallDir)\\include<\/b>.<\/li>\n<li>In Show directories for -&gt; <b>Library Files<\/b>, move <b>$(WindowsSdkDir)\\lib<\/b> up so its above <b>$(VCInstallDir)\\lib<\/b>.<\/li>\n<\/ol>\n<p>\u9078\u64c7\u7d44\u614b\u70ba Unicode Debug\uff0c\u6309\u4e0b\u958b\u59cb\u5075\u932f\uff0c\u63a5\u4e0b\u4f86\u5c31\u6703\u5728 \\PowerEditor\\visual.net\\Unicode Debug \u88e1\u751f\u51fa\u4e00\u5806\u6a94\u6848\uff0c\u9084\u6709\u5e7e\u500b OutputFile \u5c6c\u6027\u503c (notepadPlus_Debug) \u4e0d\u76f8\u7b26\u7684\u8b66\u544a\uff0c\u5148\u4e0d\u7528\u7406\u5b83\u3002<\/p>\n<p>\u628a Scintilla.dll\u3001SciLexer.dll \u5169\u500b\u6a94\u6848\u8907\u88fd\u5230 \\PowerEditor\\visual.net\\Unicode Debug \u76ee\u9304\uff0c\u7136\u5f8c\u57f7\u884c notepadPlus_Debug.exe \u61c9\u8a72\u5c31\u53ef\u4ee5\u904b\u4f5c\u4e86\u3002<\/p>\n<p>\u56db\u3001\u7de8\u8b6f\u6642\u671f\u8b66\u544a<\/p>\n<ul>\n<li>\"Error C2220 \u8b66\u544a\u88ab\u8996\u70ba\u932f\u8aa4\" \u7684\u554f\u984c\n<ul>\n<li>\u89e3\u6c7a\u8fa6\u6cd5\uff1a\u5c08\u6848 -&gt;\u5c6c\u6027-&gt;\u7d44\u614b\u5c6c\u6027-&gt; C\/C++ -&gt; \u5c07 \"\u8b66\u544a\u8996\u70ba\u932f\u8aa4\" \u7684\u503c\u6539\u70ba \"\u5426\"<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>Notepad++ \u8f38\u51fa\u6a94\u540d\u7684\u554f\u984c\n<ul>\n<li>\u89e3\u6c7a\u8fa6\u6cd5\uff1a\u5c08\u6848 -&gt;\u5c6c\u6027-&gt;\u7d44\u614b\u5c6c\u6027-&gt; \u9023\u7d50\u5668 -&gt; \u8f38\u51fa\u6a94\u6848\uff0c\u4fee\u6539\u6a94\u540d notepadPlus_Debug.exe \u70ba Notepad++.exe<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>References:<\/p>\n<ul>\n<li><a href=\"https:\/\/sourceforge.net\/apps\/mediawiki\/notepad-plus\/?title=Compiling_Notepad%2B%2B\" target=\"_blank\" rel=\"noopener noreferrer\">How To Compile Notepad++ From Source<\/a><\/li>\n<li><a href=\"http:\/\/my.oschina.net\/xiangmao\/blog\/174354\" target=\"_blank\" rel=\"noopener noreferrer\">Visual Studio 2013 \u7f16\u8bd1Notepad++\u6e90\u7801<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u7528 Visual Studio 2010 \u7de8\u8b6f Notepad++ \u539f\u59cb\u78bc  &hellip; <a href=\"https:\/\/blog.nami.idv.tw\/?p=516\">\u95b1\u8b80\u5168\u6587 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10],"tags":[],"class_list":["post-516","post","type-post","status-publish","format-standard","hentry","category-it-note"],"_links":{"self":[{"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/516","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=516"}],"version-history":[{"count":8,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/516\/revisions"}],"predecessor-version":[{"id":710,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/516\/revisions\/710"}],"wp:attachment":[{"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}