Menu

Build 4.2 & NppInsertPlugin VC++ 2008 Express

SpiroC
2007-09-21
2012-11-13
  • SpiroC

    SpiroC - 2007-09-21

    Hi

    I wanted to start playing with building npp and plugins but first I needed to check the build environments to see if I liked mingw system better than MS system.  Here is step by step instructions on how to setup MS Visual C++ 2008 Express Edition to build npp.4.2.src.  It's all in the forums here already in bits and pieces but here it is altogether.  This procedure worked for me using WinXP Sp2.

    Firstly, if you want to setup the mingw tools (dev-c++, codeblocks), then take a look at the TextFX website by Chris Severance (http://textfx.no-ip.com/textfx/).  He has done a fantastic job of setting up simple instructions and npp projects for several IDE's.

    To setup VisualC++ 2008 Express Edition:

    1.  Download and install: "Visual C++ 2008 Express Edition".  There are 3 components, I only installed the first (IDE) and not the other 2 (MSDN, Database).
    2.  Run it once to set up environment (mentioned somewhere in SDK docs to do this)
    3.  Download and install the platform sdk whose exact name is "Windows Server 2003 R2 Platform SDK"
    4.  Do the 3 installation steps listed in the Platform SDK Documentation under Getting Started -> Using the Platform SDK -> Installing the Platform SDK.  Namely:
            Go to Tools -> Options -> Projects and Solutions -> VC++ Directories and use up down arrows keys to:
            A.  In Executable Files, move $(WindowsSdkDir)\bin up so its above $(VCInstallDir)\bin
            B.  In Include Files, move $(WIndowsSdkDir)\include up so its above $(VCInstallDir)\include
            B.  In Library Files, move $(WIndowsSdkDir)\lib up so its above $(VCInstallDir)\lib
    5.  Download and unzip npp.4.2.src into My Documents\Visual Studio 2008\Projects\ 6.  Download and unzip NppInsertPlugin into My Documents\Visual Studio 2008\Projects\

    Build Notepad++ 4.2 (win32, Debug):
    7.  Within VC++ IDE select File -> Open -> Project/Solution and open the project My Documents\Visual Studio 2008\Projects\npp.4.2.src\scintilla\vcbuild\SciLexer.dsp
    8.  Allow the project upgrade wizard to run with defaults
    9.  Within the Solution Explorer window, right click on Solution 'SciLexer' and select Add -> Existing Project
    10. Open My Documents\Visual Studio 2008\Projects\npp.4.2.src\PowerEditor\visual.net\notepadPlus.vcproj.  IMPORTANT: do NOT open notepadPlus.7.0.vcproj, it doesn't build (linker error).
    11. Allow the project upgrade wizard to run with defaults
    12. Select Project -> Build Order and confirm that SciLexer is before notepadPlus in the build order
    13. There is a minor post build error than can be fixed by downloading npp4.1.1.src.zip, extracting the folder PowerEditor\src\font and copying it to the same place in your project My Documents\Visual Studio 2008\Projects\npp.4.2.src\PowerEditor\src\font.  Alternatively, you can go into Project -> Properties -> Configuration Properties -> Build Events -> Post Build Event and modify the command line which copies linedraw.ttf from the font directory.
    14.  Build the solution.  When prompted save your vc2008 project somewhere (eg My Documents\Visual Studio 2008\Projects\npp.4.2.src\PowerEditor\visual.net\SciLexer vc2008).  The IDE should build Scintilla first, followed by Notepad++.  There will be lots of warnings but there should be no errors.

    The result of the scintilla build is the dll (and associated files) in: My Documents\Visual Studio 2008\Projects\npp.4.2.src\scintilla\bin
    The result of the Notepad++ build is the exe in: My Documents\Visual Studio 2008\Projects\npp.4.2.src\PowerEditor\visual.net\Debug
    15. Close the project with File -> Close Solution

    Build NppInsert Plugin (win32, Debug):
    16. Within VC++ IDE select File -> Open -> Project/Solution and open the project My Documents\Visual Studio 2008\Projects\NppInsertPlugin\NppInsertPlugin.vcproj
    17. Allow the project upgrade wizard to run with defaults
    18. Build the solution.  Save your vc2008 project when prompted.

    The result of the plugin build is found in a newly created directory under My Documents\Visual Studio 2008\Projects\.  The path is: My Documents\Visual Studio 2008\Projects\notepad++\PowerEditor\bin\plugins

    TODO:
        - Follow the compiler output instructions on how to set the environment variable to turn off all the deprecation warnings
        - Try the Release builds to see if they work.
       
    spiroc

     
    • Nobody/Anonymous

      Hi,

      Is there any test unit used to test Notepadd++ before release?

      Regards.

       
    • Nobody/Anonymous

      I am very interested in your project. I am thinking of learning C++. I have pondered whether I should actually spend the time. I have some questions. Is VC++ 2008 Express (New) free? Have you used it before to do any coding? Is it adequate for changing Notepad++. Where do you get it? You seemed to have given anyone that wants to learn C++ a good blue print for the setup of the environment and sources to get information and ideas from if they need them. Good Job! Do you know of any good books, white papers, and tutorials on the subject. Tutorials would be good to get started on a project. Also, let me know who all your contacts are for this project. In case I need some help or direction.

      Sincerely,
      Bob

       
    • Idris Samawi Hamid

      Hi,

      This is a wonderful contribution! Please consider posting it online somewhere as well. Maybe even a wiki where others can share experiences/problems compiling. As a non-programmer (but who would like to tinker with simple things) I really appreciate the detail you've put into this!

      Besst
      Idris

       
    • SpiroC

      SpiroC - 2007-09-22

      Bob,
      Programming is definitely worth learning if you are that way inclined.  Visual C++ 2008 Express Edition is free (you do need to have an authentic version of windows to download it).  If you are just getting started, then you have to learn a language, learn IDE features and learn about specific projects. 

      I am a programmer but my experience is with embedded development tools and other languages (c and assembler).  I can't advise you about the Notepad++ project specifically as I have only just started myself (so my contacts the moment are this forum!).  I'm the type of person that wants to make sure the tools are right before I commit to spending lots of hours (who knows, maybe hundreds in the long term) using it.  I looked at the source code for the first time a couple of days ago.  Yesterday I added a resource editor, CVS tool and SVN tool to the mix (XN Resource Editor, TortoiseCVS, TortoiseSVN) and so far so good it all works (yay!).  I would say for language assistance, Google is your friend, for IDE assistance, use the resources on the IDE sites (help files, and forums) and for learning the projects (eg Notepad++ and npp-plugins), use these forums, use the source code itself or email the project members if you are really stuck (but avoid asking them simple questions that can be answered by a simple Google search).

      As far as adequacy goes, all the tools are good enough for this (including but not limited to Visual C++, Codeblocks and Dev-C++).  You need to do your own research as I did to decide which ones suite you.  Its a big topic that people are very passionate about. My own personal OPINION based on what I have seen and what I have read is that the Microsoft tools are better for developing on the Windows platform (they are more complete, more professional and the IDE has a few code browsing features) but there are still plenty of reasons that people don't use them, such as:
      1. You're looking at 800 MB plus downloads vs less than 20 MB so its a big download and a huge installation
      2. The open source dev tools are already good enough and getting better
      3. The VC++ Editor is still not in the league of commercial code analysers/browsers like Source Insight, Understand for C/C++ and Crystal Revs
      4. If you learn to use Visual C++, you are not learning any cross platform development skills.  If you ever want to learn how to develop on linux, you will need to learn a new set of tools, IDEs etc.  If you learn gcc now, at learn there will be some familiarity if you move to linux later on.

      Hope this helps, good luck with you endeavors,

      Spiro

       
    • pjkaus

      pjkaus - 2007-09-23

      I can confirm that the above instruction work with Visual Studio C++ 2005 Express.
      I pointed out the missing font file over two weeks ago. I expected this was an inadvertent omission and that it would be added back to the svn but it was still missing last time looked.
      I am not a programmer but have been trying to decide on what tools I want to become familiar with for my programming pleasure. I like to use open source tools as I find reading the source very instructive. I have spent some time mostly lurking in the  codeblocks forum. Bob If your are looking for crossplatform, codeblocks and wxwidgets seem to have a strong following and the codeblocks forum seems happy to answer queries even when they seem of topic.

      The advantage with  microsoft tools such as the express editions is the helpfiles, the debugger and the context menu with "goto definition/declaration" and call browser, which are so helpful when you are trying to find your way around a fair sized project such as notepad plus.

      If one is trying to learn windows api programming there would seem to be a lot to learn from this project, but I suspect the developers here have there hands full because many queries in the forums seem to go unanswered. As i pointed out above I reported the missing font file two weeks ago and a few days back reported a bug in the run menu command with as yet no comment from developers. Both of these post would seem directly relevant to improving the product.

       
      • Don HO

        Don HO - 2007-10-28

        > I pointed out the missing font file over two weeks ago. 

        FYI : the font file was added in svn.

        > As i pointed out above I reported the missing font file two weeks ago
        > and a few days back reported a bug in the run menu command with as yet no comment from developers.
        > Both of these post would seem directly relevant to improving the product.

        Thank you for the patch.
        It'll be fixed in the next release.

        I suggest you submit your patch here for the next time :
        http://sourceforge.net/tracker/?group_id=95717&atid=612384
        where is more visible for me.

        As the only developer in this project, I prefer to deal with the patches rather than with the bugs.

        Don

         
        • pjkaus

          pjkaus - 2007-10-29

          Hi Don HO
          Thank for including the patch. I was wondering how to get it noticed.
          I would like to help but I am not sure I have the skill set to be terribly useful.

           
      • steakhacher

        steakhacher - 2007-10-28

        Hi

        I try to compile a plugin (multiclipboard) with VS Express 2005 on Vista but even I follow all the SDK steps it seems that there is a problem with the include file indeed it doesn't find window.h

        Has someone an idea.

        Thanks a lot

         
        • pjkaus

          pjkaus - 2007-10-29

          Hi steakhacher
          If windows.h is not found then the sdk is not installed or the VS Express is not configured to look in the sdk directories to find it. Please clarify exactly what you have done to follow the "sdk steps".
          To check open Visual studio. Select menu item Tools/options
          In the dialog box expand "Projects and Solutions" and select "VC++ Directories" and in the dropdown box "Show directories for" select "include Files". This list should include "c:\Program Files\Microsoft Platform SDK\include" or similar which is where windows.h is found.
          If this is not the case it suggests you have not set up sdk for VS express.
          please report back what you find.

           
          • steakhacher

            steakhacher - 2007-11-01

            Hi

            Thanks for your answer. I have follow all the step of the SDK installation (or I thinks) I have add include using the Visual Interface
            tools> option | project and solution VC++ directory
            platform : Win 32
            I have at the top of the list for executable : $(WindowsSdkDir)bin
            include $(WIndowsSdkDir)include
            library $(WIndowsSdkDir)lib

            With definition of WindowsSdkDir as a user variable (I have also try systeme variable) containing C:\Programmes\Microsoft Platform SDK for Windows Server 2003 R2
            So if this variable is not defined it give me an error $(WIndowsSdkDir) not defined

            The file windows.h is present at C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include and if I changed <windows.h> by "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\windows.h" it is ok but to compile something it would be also necessary change evrywhere the <>  by "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\***" which is not possible...

            Hope that you could help me...

            Thanks a lot

             
    • Nobody/Anonymous

      Hi Spiroc,

      Thanks for the advice. I can successfully build the NP++. However, how should I debug it? If I debug directly from ..\SciLexer vc2008\SciLexer.sln, then there will be a pop-up for to choose where I should debug from. If I run from notepadPlus.vcproj, then there is SCINTILLA ERROR: Can not load dynamic library.

       
    • pjkaus

      pjkaus - 2007-10-25

      You will need to move scilexer.dll to the debug build directory PowerEditor/visual.net/Debug

       
    • Don HO

      Don HO - 2007-10-28