Troubles building and executing NPP
-
Expounding my comment with screenshots:
When I compile the cintrilla binaries with the argument ‘nmake BOOSTPATH=C:\sources\boost_1_70_0\ BOOSTREGEXLIBPATH=C:\tmp\scintilla.414\boostregex -f scintilla.mak’ in VS2019 on Windows 10, it fails to compile with >100 errors.
Here’s a shot of my directory folders containing the necessary dependent files for the arguments BOOSTPATH & BOOSTREGEXLIBPATH:
One thing I’m concerned about, is the use of ‘C:\ProgramFiles (x86)’ directory path for my NPP directory location. The reason being is when using the command in PowerShell "cd C:\ProgramFiles (x86)\your-path-here’, the command cd thinks (x86) is a parameter instead of being part of the directory name, so I have to ‘tab-surf’ my cd command to get into the containing directory. Can I safely rename the directory folder for ‘C:\ProgramFiles (x86)’ to ‘C:\ProgramFilesx86’ to eliminate this syntax mess and test it as a solution?
-
Hmmm, I don’t know if it makes any difference, but I would not attempt a build under Powershell. I would build under CMD.exe.
Also, you’d want a CMD.exe that has the environment all set up for building with Visual Studio, like the readme directs.
-
@Alan-Kilborn The ReadME and Windows Documentation recommends running NMake from the Command Console of Visual Studio, I tried to change from Developer PowerShell to Developer Command Prompt to no avail. I’m going to delete NPP, unzip, and try again.
-
I went ahead and tried running the command directly through the cmd.exe with VS Build environment, just to get it out of the way, as well as re-extracting the source files, and I get the same error. Looks like this:
I also went ahead and extracted into the regular program files directory… It’s not a naming syntax issue either it seems… I’m probably messing up on something incredibly silly…
I’m just gonna install with the wizard, spending too much time on this project! But it was fun to try, I’ll be back when I learn more about linking and building binaries from source.
-
My build of the SciLexer.dll project, in two clicks
Run as administrator x86 Native Tools Command Prompt for VS 2017
Copy all code, paste into x86 Native Tools Command Prompt for VS 2017, and press Entercd C:\sources\boost_1_70_0 bootstrap.bat cd C:\sources\boost_1_70_0\libs\regex\build C:\sources\boost_1_70_0\b2.exe toolset=msvc link=static threading=multi runtime-link=static address-model=32 release stage C:\sources\boost_1_70_0\b2.exe toolset=msvc link=static threading=multi runtime-link=static address-model=64 release stage md C:\tmp\boostregexLib\x32 md C:\tmp\boostregexLib\x64 copy C:\sources\boost_1_70_0\stage\lib\libboost_regex-vc141-mt-s-x32-1_70.lib C:\tmp\boostregexLib\x32 copy C:\sources\boost_1_70_0\stage\lib\libboost_regex-vc141-mt-s-x64-1_70.lib C:\tmp\boostregexLib\x64 exit /b
Run as administrator x86 Native Tools Command Prompt for VS 2017
Copy all code, paste into x86 Native Tools Command Prompt for VS 2017, and press Entercd C:\notepad-plus-plus-master\scintilla\win32\ nmake BOOSTPATH=C:\sources\boost_1_70_0\ BOOSTREGEXLIBPATH=C:\tmp\boostregexLib\x32\ -f scintilla.mak copy /y "C:\notepad-plus-plus-master\scintilla\bin\SciLexer.dll" "C:\notepad-plus-plus-master\PowerEditor\bin\SciLexer.dll" exit /b
This is an assembly of the x64 project
Run as administrator x86_x64 Cross Tools Command Prompt for VS 2017
Copy all code, paste into x86_x64 Cross Tools Command Prompt for VS 2017, and press Entercd C:\notepad-plus-plus-master\scintilla\win32\ nmake BOOSTPATH=C:\sources\boost_1_70_0\ BOOSTREGEXLIBPATH=C:\tmp\boostregexLib\x64\ -f scintilla.mak copy /y "C:\notepad-plus-plus-master\scintilla\bin\SciLexer.dll" C:\notepad-plus-plus-master\SciLexer.64.dll exit /b
-
I forgot to say that the project was built on Windows 7 Home Premium (32-bit)
-
@Alan-Kilborn
I’m pretty sure to have the necessary files since there is no change on the branch I’m compiling(master commit=8516c7b).
What I’m not sure about is if it’s from the "\visual.net\x64\Unicode Debug.” that my debug version should be located. It’s auto-generated by VS-2017, so it should normally be right. -
@ErwanDelhoveUCL said in Troubles building and executing NPP:
the version I try to launch is located at “\visual.net\x64\Unicode Debug.”
I don’t think it will run directly from there without “help”: I think you may have to copy some files into that folder as well first.
I’m pretty sure to have the necessary files since there is no change on the branch I’m compiling…
That’s not what I mean.
Okay, here’s what I’d do as a quick test of your built exe:-
Grab a released portable zip.
-
Unzip into a folder.
-
Put your build of
notepad++.exe
in that folder (overwriting the released one). -
Try running that.
I’m not saying for sure that this will solve the problem you cited, but it is worth trying.
-
-
@Alan-Kilborn
I did it with the most recent version(Notepad++ 7.9: Stand with Hong Kong) and it works fine.
I think i found the issue: SciLexer.dll is baldy made or miss some elements(release version is bigger than generated one)
-
@ErwanDelhoveUCL said in Troubles building and executing NPP:
SciLexer.dll is baldy made or miss some elements(release version is bigger than generated one)
So I’m not sure what your goals are for building Notepad++.
Maybe just for fun?But if you are going to experiment and change code, then you want to do this in the “Debug” build.
And with that it doesn’t matter if for Scintilla the “release version is bigger…”
So I think your issues are all solved now?
-
@Alan-Kilborn
I think that you didn’t understand what I wanted to tell you.
I 'm speaking of the SciLexer.dll that I generate myself for the last version of the project. I’ve put the SciLexer.dll version of the release in the debug folder. When I executed the debug version again, it worked!
I deduct so that it was my generated SciLexer.dll who leads to the given error. Maybe I made a mistake in my command line or something like that. So I’m going to investigate there. -
@ErwanDelhoveUCL said in Troubles building and executing NPP:
I think that you didn’t understand what I wanted to tell you.
Correct. :-)
I deduct so that it was my generated SciLexer.dll who leads to the given error.
Maybe I made a mistake in my command line
Hmm, I think if it builds, it should work.
Again, as long as we are talking about a “debug” version ofnotepad++.exe
running it. -
@ErwanDelhoveUCL said in Troubles building and executing NPP:
I think i found the issue: SciLexer.dll is baldy made or miss some elements(release version is bigger than generated one)
The x32 and x64 versions have different file sizes!
-
I got this file size:
-
This post is deleted! -
@andrecool-68
A new problem appear with this following command execution:
FYI i use the x86_x64 Cross Tools Command Prompt for VS 2017 as an adminstratorI got this error in return.
It basically tell me that I should target the same processor. Because the Front end and Back end are not compatible.
Any idea how to fix it?
-
I think I found a page for my error. Trying it right now and I will tell you if it works.
https://sourceforge.net/p/notepad-plus/discussion/331753/thread/b2610e04/ -
Yeah it works. Thanks to you guys(@Alan-Kilborn ,@andrecool-68 ). I finally succeed to run notepad++ (debug version) with my own generated Scintilla.dll(x64 version).
Maybe we should keep this discussion at disposal for other people encountering the same problem (and I’m also not the only one to have 64 processor version ;) ).
What do think? Maybe I should add tag or something else?
-
@ErwanDelhoveUCL I am doing SCINTILLA cleanup with bat file CLEAR_SCINTILLA.bat
I did not know about other methods))del /f /q C:\notepad-plus-plus-master\scintilla\win32\Accessor.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\AutoComplete.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\BoostRegexSearch.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\CallTip.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\CaseConvert.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\CaseFolder.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\Catalogue.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\CellBuffer.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\CharacterCategory.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\CharacterSet.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\CharClassify.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\ContractionState.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\DBCS.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\Decoration.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\DefaultLexer.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\Document.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\EditModel.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\Editor.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\EditView.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\ExternalLexer.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\HanjaDic.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\Indicator.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\KeyMap.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexA68k.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexAbaqus.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexAda.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexAPDL.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexAsm.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexAsn1.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexASY.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexAU3.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexAVE.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexAVS.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexBaan.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexBash.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexBasic.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexBatch.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexBibTeX.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexBullant.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexCaml.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexCIL.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexCLW.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexCmake.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexCOBOL.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexCoffeeScript.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexConf.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexCPP.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexCrontab.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexCsound.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexCSS.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexD.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexDataflex.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexDiff.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexDMAP.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexDMIS.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexECL.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexEDIFACT.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexEiffel.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexerBase.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexErlang.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexerModule.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexErrorList.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexerSimple.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexEScript.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexFlagship.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexForth.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexFortran.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexGAP.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexGui4Cli.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexHaskell.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexHex.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexHTML.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexIndent.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexInno.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexJSON.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexKix.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexKVIrc.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexLaTeX.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexLisp.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexLout.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexLua.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexMagik.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexMake.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexMarkdown.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexMatlab.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexMaxima.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexMetapost.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexMMIXAL.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexModula.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexMPT.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexMSSQL.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexMySQL.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexNim.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexNimrod.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexNsis.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexNull.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexObjC.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexOpal.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexOScript.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexPascal.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexPB.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexPerl.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexPLM.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexPO.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexPOV.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexPowerPro.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexPowerShell.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexProgress.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexProps.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexPS.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexPython.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexR.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexRebol.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexRegistry.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexRuby.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexRust.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexSAS.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexScriptol.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexSearchResult.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexSmalltalk.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexSML.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexSorcus.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexSpecman.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexSpice.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexSQL.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexStata.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexSTTXT.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexTACL.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexTADS3.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexTAL.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexTCL.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexTCMD.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexTeX.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexTxt2tags.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexUser.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexVB.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexVerilog.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexVHDL.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexVisualProlog.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexX12.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LexYAML.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\LineMarker.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\MarginView.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\PerLine.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\PlatWin.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\PositionCache.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\PropSetSimple.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\RESearch.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\RunStyles.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\ScintillaBase.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\ScintillaBaseL.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\ScintillaDLL.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\ScintillaWin.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\ScintillaWinL.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\ScintRes.res del /f /q C:\notepad-plus-plus-master\scintilla\win32\Selection.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\Style.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\StyleContext.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\UniConversion.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\UniqueString.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\UTF8DocumentIterator.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\vc140.pdb del /f /q C:\notepad-plus-plus-master\scintilla\win32\ViewStyle.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\WordList.obj del /f /q C:\notepad-plus-plus-master\scintilla\win32\XPM.obj del /f /s /q C:\notepad-plus-plus-master\scintilla\bin exit /b
-
It can be even easier to build a project if you run it from these three bat-files:
Run as administrator
x86 Native Tools Command Prompt for VS 2017
call "full_file_path\x32_x64_START_BOOST.bat"
Enter@echo on cd C:\sources\boost_1_70_0 call bootstrap.bat cd C:\sources\boost_1_70_0\libs\regex\build C:\sources\boost_1_70_0\b2.exe toolset=msvc link=static threading=multi runtime-link=static address-model=32 release stage C:\sources\boost_1_70_0\b2.exe toolset=msvc link=static threading=multi runtime-link=static address-model=64 release stage md C:\tmp\boostregexLib\x32 md C:\tmp\boostregexLib\x64 copy C:\sources\boost_1_70_0\stage\lib\libboost_regex-vc141-mt-s-x32-1_70.lib C:\tmp\boostregexLib\x32 copy C:\sources\boost_1_70_0\stage\lib\libboost_regex-vc141-mt-s-x64-1_70.lib C:\tmp\boostregexLib\x64 exit
Run as administrator
x86 Native Tools Command Prompt for VS 2017
call "full_file_path\x32_START_SCINTILLA.bat"
Enter@echo on cd C:\notepad-plus-plus-master\scintilla\win32\ nmake -f scintilla.mak clean nmake BOOSTPATH=C:\sources\boost_1_70_0\ BOOSTREGEXLIBPATH=C:\tmp\boostregexLib\x32\ -f scintilla.mak copy /y "C:\notepad-plus-plus-master\scintilla\bin\SciLexer.dll" "C:\notepad-plus-plus-master\PowerEditor\bin\SciLexer32.dll" exit
Run as administrator
x86_x64 Cross Tools Command Prompt for VS 2017
call "full_file_path\x64_START_SCINTILLA.bat"
Enter@echo on cd C:\notepad-plus-plus-master\scintilla\win32\ nmake -f scintilla.mak clean cd C:\notepad-plus-plus-master\scintilla\win32\ nmake BOOSTPATH=C:\sources\boost_1_70_0\ BOOSTREGEXLIBPATH=C:\tmp\boostregexLib\x64\ -f scintilla.mak copy /y "C:\notepad-plus-plus-master\scintilla\bin\SciLexer.dll" "C:\notepad-plus-plus-master\PowerEditor\bin\SciLexer64.dll" exit