succesfull build

  • pjkaus

    pjkaus - 2007-08-29

    I am fairly new to windows programming and I suspect similar to others who have posted questions about compiling npp. i have been reading the source code for npp over the last month and yesterday tried to build from source for the first time. No joy with msvc8, mingw make or codeblocks. Searched the forum and was disappointed to see many requests for information on building but no helpful replies, only an acknowledgement that the make files were out of date.

    I was begining to feel like jumpyfroggy that I would have to look elsewhere for a better supported opensource editor.

    Downloaded 4.2 source and svn sources to find new build system with cmake.

    Scintilla now builds from nmake and vc compiler flawlessly and PowerEditor builds in Visual Studio 2005 C++ Express with the one error being the omision of the PowerEditor/src/font directory. Fortunately I had kept a copy of old sources. It is also still available in the svn repository which is otherwise out of date.

    Now building with Visual Studio 2005 C++ could not be simpler. All that is required is to set path, include and lib environment variable for visual studio and platform sdk, open dos box in scintilla/win32 directory and type "nmake -f scintilla.mak"
    copy font directory from cvs sources to PowerEditor/src directory of svn source code. Open PowerEditor/ in  visual studio and press build.

    Hopefully the font directory will be restored in due course.

    • Nobody/Anonymous


      Can I built the project in Windows Vista? How? Thanks

    • Nobody/Anonymous

      Your message isn't all that clear to me.

      Are you saying I can build NP++ from the source code using MS 2005 VC++ Express Edition?

      Could you perhaps give a simple, yet complete description of what files to download, how to install and what else to configure? Please be specific, because I can't make much of your detail listing above.

      An other message on the Open Forum is speaking about MFC.
      Did you have to download or install that?
      Where did you get it, in that case?

    • pjkaus

      pjkaus - 2007-08-31

      Sorry I was not clear.
      Yes you can build np++ with MS VC++ 2005 Express and the Platform SDK
      The current problem is that the source download for 4.2 is missing the PowerEdit/src/font directory. It is also missing from the svn. However it is present in the cvs which was still accessible just now although the link has disappeared from the sourceforge site.
      I use the cvs under cygwin bash and use the following command.
      "cvs co notepad-plus"
      windows tools such as tortoise cvs should do the same.
      The font directory was also available in older source distributions. The font directory contains only linedraw.ttf.

      Microsoft foundation classes are not used by np++ and so are not required.

      The np++ makes use of the scintilla control and the source for this is included in the scintilla directory. To compile the scintilla control open a dos box and change to the scintilla/win32 directory. and execute the following command
      "nmake -f scintilla.mak"
      this presumes that you have set up the path, include and lib environment variables to suit. If your are not familiar with this ask again. This will produce scintilla.dll in scintilla/bin.

      Now browse to notepad-plus/PowerEditor/ and double click on notepadplus.vcproj.
      If your file associates are correctly set this should open msvc++. Click on Build menu and select build solution.
      The compile should proceed. If your do not have the font directory you will find the post build event will report an error copying the font/linedraw.ttf. Otherwise the compile will complete.

      • Nobody/Anonymous

        Where in the Notepad++ project is linked to this scintilla/bin folder?

        I suppose I should see changes in the scintilla source code reflected when NP++ is built again. Currently, this doesn't seem to be the case.

      • Nobody/Anonymous

        Yep, what's with the path, include and lib environment variables?
        Where does this make command come from?

        • Nobody/Anonymous

          ... and if I build the solution in VC++ I get a lot of these errors:

          ------ Build started: Project: Notepad++, Configuration: Debug Win32 ------
          g:\_Unzip\PowerEditor\src\WinControls\Window.h(21) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

          So nothing about linedraw.ttf missing, but I can't compile. I don't know if this has to do with my not being able to build the scintilla.dll.

          Is there anything (more) I need to set in VC++ to make it work??

    • pjkaus

      pjkaus - 2007-09-02

      Did you install the Microsoft Platform SDK?
      The errors you are getting is because the compiler cannot find include files which are part of the the Platform SDK.
      nmake is distributed with the SDK and is used to drive the command line compile of scintilla. If you have not installed the SDK you will certainly not be able to compile the scintilla component either.

      After installing Microsoft Visual C++ Express, c;|Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat is a batch file which will set up the environment variables "path", "include", "lib" for the compiler. The PSDK requires further directories to be added to these variables. the following reference gives some ideas.

      If you truly don't know what an environment variable is, I would think you should start your reading there before you try compiling Notepad++.
      environment variable ->
      nmake ->

      when you get to the point of getting your development environment installed the build will work till it gets to the post compile event manager when it tries to find linedraw.ttf. That is unless the svn gets updated to include it again.

      • Nobody/Anonymous

        Thanks for pointing that out! I didn't have the Platform SDK installed.
        I followed the instructions on Microsoft's website.

        I am now able to build NP++ with VC++ Express Edition.
        I haven't even used any nmake command...
        I didn't have to read any environment variable stuff.

        The only problem I seem to have now, is that every other compile is (un)successful.
        I seem to get the same error for the 'missing' linedraw.ttf each first time.
        When I immediately build the solution again, it succeeds rightaway.

        Thank you very much for your explanations.

        • Nobody/Anonymous

          After moving the linedraw.ttf file to the font subfolder NP++ builds fine..

          • pjkaus

            pjkaus - 2007-09-03

            Notepad++ requires scilexer.dll. To compile it requires only the include files in scintilla\include. But to run it must find scilexer.dll.
            Scilexer.dll is built from scintilla source code as I have indicated above. This file must then be in your path or the directory in which notepad++.exe resides so that it can be found at run time.
            If you have note compiled scintilla you are only half way there.

            • Nobody/Anonymous

              Thanks again. I think you are mistaken about mentioning the SciLexer.dll before.
              After copying the newly made version to the NP++ directory, I finally got rid of the inability to move blank lines down by using CTRL+SHIFT+DOWN.

              • pjkaus

                pjkaus - 2007-09-04

                If you look in notepad++ install directory you will find scilexer.dll there. It cannot work without. If you want to install from source both directories need compilation. Of course it is fine to use the  dll which is in the binary install if you wish only to make changes to the PowerEditor directory.

    • Nobody/Anonymous

      I still got this error after I had installed the Platform SDK, follow the setup as in MSDN website and build the scintilla.dll.

          Searching C:\Program Files\Microsoft Platform SDK\Lib\winspool.lib:
          Searching C:\Program Files\Microsoft Platform SDK\Lib\comdlg32.lib:
          Searching C:\Program Files\Microsoft Platform SDK\Lib\advapi32.lib:
          Searching C:\Program Files\Microsoft Platform SDK\Lib\ole32.lib:
          Searching C:\Program Files\Microsoft Platform SDK\Lib\oleaut32.lib:
          Searching C:\Program Files\Microsoft Platform SDK\Lib\uuid.lib:
          Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\libcpmtd.lib:
      Finished searching libraries
      Notepad_plus.obj : error LNK2001: unresolved external symbol "protected: virtual int __stdcall ColumnEditorDlg::run_dlgProc(unsigned int,unsigned int,long)" (?run_dlgProc@ColumnEditorDlg@@MAGHIIJ@Z)
      Debug/notepadPlus_Debug.exe : fatal error LNK1120: 1 unresolved externals
      Build log was saved at "file://c:\Documents and Settings\Annie\Desktop\npp.4.2.src\PowerEditor\\Debug\BuildLog.htm"
      notepadPlus.7 - 2 error(s), 1032 warning(s)
      ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

      Pls advice :(

    • Harry

      Harry - 2007-10-16

      columneditor.cpp and columneditor.h
      found in SCintillaComponent to the project and recompile, it should work.

    • Nobody/Anonymous

      I had add the columneditor.cpp and columneditor.h but still wouldn't work. I think maybe its the scintilla.dll. Where should I put the scintilla.dll or how should the setting be to call the dll from VC8++? Thanks


    • Nobody/Anonymous

      When I run the Scintilla, fatal error occured. Below is the error.
      How should I run the Scintilla files without error and where to keep the .dll
      files ? Pls advice.

      Setting environment for using Microsoft Visual Studio 2005 x86 tools.

      C:\Documents and Settings\Annie\Desktop\npp.4.4.src\scintilla\win32>nmake -f sci

      Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
      Copyright (C) Microsoft Corporation.  All rights reserved.

              cl -Zi -TP -W4 -Zc:forScope -Zc:wchar_t -D_CRT_SECURE_NO_DEPRECATE=1 -O1
      -MT -DNDEBUG -GL -I../include -I../src -c -Fo.\AutoComplete.obj ..\src\AutoComp
      Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
      Copyright (C) Microsoft Corporation.  All rights reserved.

      C:\Documents and Settings\Annie\Desktop\npp.4.4.src\scintilla\include\Platform.h
      (22) : fatal error C1083: Cannot open include file: 'windows.h': No such file or
      NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\c
      l.EXE"' : return code '0x2'

    • Nobody/Anonymous

      More errors found... :(

      c:\Documents and Settings\Annie\Desktop\npp.4.2.src\PowerEditor\src\resource.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
      c:\Documents and Settings\Annie\Desktop\npp.4.2.src\PowerEditor\src\resource.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
      c:\documents and settings\annie\desktop\npp.4.2.src\powereditor\src\resource.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
      c:\Documents and Settings\Annie\Desktop\npp.4.2.src\PowerEditor\src\resource.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
      c:\Documents and Settings\Annie\Desktop\npp.4.2.src\PowerEditor\src\resource.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
      Generating Code...
      LINK : fatal error LNK1181: cannot open input file 'C:\Documents.obj'
      Build log was saved at "file://c:\Documents and Settings\Annie\Desktop\npp.4.2.src\PowerEditor\\Debug\BuildLog.htm"
      Notepad++ - 1 error(s), 135 warning(s)
      ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    • pjkaus

      pjkaus - 2007-10-18

      Its 6 weeks since opening this thread and there have been two releases since that time so it would be helpful if posters identified the source they are using. Obvious one poster 4.2 another 4.4 and the third not specified. It would also be helpful if postered registerd and logged in so that one could see how many different reports are coming from different setups.

      My original compilation of scintilla was flawed because the make file had not been updated to include the notepad-plus  modifications for configurable syntax highlighting. This can be done but it is easier to follow the instructions given by Spiroc in this forum which use the .vcprog files.

      I have had no trouble compiling 4.2 or 4.3 and have not yet tried 4.4.

      for the last poster, I'm sorry i know very little about codepages.
      for the second last your error indicates that windows.h cannot be found which suggests you have not installed the platform sdk or if you have you have not set up the required environment variables to enable the compiler to find it. Use Spiroc's approach and build from the ide.
      The poster with a link error on ColumnEditorDlg::run_dlgProc , the only way I could immageine this happening is if the project was not upto date. I suggest you download and extract the source files again and start again with spiroc's instructions.