9

I downloaded the latest Notepad++ from the official website, then tried different libxml.dll files to make XML Tools plugin work. Last one I tried was from here (should be official rep):

So when I unpack a DLL from the above 7z archive (x64), and start an instance of Notepad++, I'm getting this error:

enter image description here

Any ideas on how to fix this issue?

I'm open to suggestions on downgrading my Notepad++, just need to know which version.

Victor Zakharov
  • 636
  • 3
  • 11
  • 19
  • Having you tried installing from the Plugin Manager? – heavyd Dec 19 '13 at 19:56
  • Are you running a 64-bit version of Notepad++? If not, why are you downloading a 64-bit version of libxml? BTW, the version of libxml that is required for XML Tools is provided *in the download for XML Tools*, all you have to do is move it to the directory where notepad++ resides. – allquixotic Dec 19 '13 at 19:57
  • @heavyd: I did not find it in the Plugin Manager's list of plugins. – Victor Zakharov Dec 19 '13 at 20:01
  • @allquixotic: You may be right about that. My Notepad++ is 32-bit, just thought because my Windows is x64, I need x64. Extracting the included files with XML Tools is the first thing I tried. It said something about ANSI plugins not being compatible with my Unicode Notepad++. Not sure what that means. I have not found any **other** version of Notepad++ on the official website. – Victor Zakharov Dec 19 '13 at 20:02
  • It is mistaken to think that you have to use binaries of the same bitness as your operating system. While you can't run 64-bit binaries on a 32-bit OS, you *can* run 32-bit binaries on a 64-bit OS. In fact, the vast majority of the binaries you run, whether you realize it or not, are 32-bit, due to legacy reasons (and because 32-bit binaries work on everyone's computer, while 64-bit binaries only work on computers with 64-bit Windows). – allquixotic Dec 19 '13 at 20:06
  • In fact, you will *never* be able to get this working by using a 64-bit build of libxml2 with a 32-bit Notepad++, because you can never link binaries of different bitness into the same address space (when Notepad++.exe starts, it dynamically loads all the DLLs into the same address space). – allquixotic Dec 19 '13 at 20:07
  • @allquixotic: I am not claiming that I did it right. I'm just saying that I tried different options, including the one you posted below - and none worked for me. – Victor Zakharov Dec 19 '13 at 20:07
  • 1
    Try this: in the base Notepad++ directory, delete all .DLL files except for `SciLexer.dll`. In the plugins directory, make sure you do not have iconv, libxml2, libxslt, or zlib1 DLLs sitting around, because Notepad++ will try to dynamically load these as plugins. But those four DLLs are **not Notepad++ plugins**; they are *dependencies* of the `XMLTools.dll` plugin. So you will get an error about "ANSI" from that. – allquixotic Dec 19 '13 at 20:09
  • @allquixotic: I got confused with what needs to be where. Yes, after I put those non-Notepad++ plugins into NPP root, everything worked perfectly. I originally put them inside plugins folder. Please edit your answer, so that it's helpful to others. – Victor Zakharov Dec 19 '13 at 20:17

2 Answers2

9

When you get into this kind of scenario, you have probably done the install of the required dependencies wrong. Things to look for:

  1. If your Notepad++ is a 32-bit executable, you must not have 64-bit DLLs (or vice versa). The bitness of the DLLs and the bitness of notepad++.exe must match (32-bit to 32-bit, or 64-bit to 64-bit).

  2. Make sure you don't have XMLTools.dll sitting in the base directory where the notepad++.exe lives.

  3. Make sure you don't have any of the four XMLTools.dll dependencies sitting in the plugins directory! The plugins directory is only for actual Notepad++ plugins; any other DLLs sitting in the plugins directory will be dynamically loaded by Notepad++ and attempted to be activated as plugins. But, since libxml2, iconv, etc. are not actual plugins, but rather, dependencies for XMLTools, the dynamic load will fail, because these DLLs do not have the Notepad++ plugin hooks. This will cause weird errors about "ANSI" and stuff.

  4. If you don't have any other plugins installed that require native dependencies, you can safely delete any DLL file in the same directory as the notepad++.exe, except for SciLexer.dll. SciLexer is a core component of Notepad++ and must be kept.

  5. If you haven't done this yet, look in \path_to_your_notepad++_installation\notepad++\plugins\ext_libs

Copy those DLLs to the same directory as notepad++.exe:

iconv.dll
libxml2.dll
libxslt.dll
zlib1.dll
allquixotic
  • 34,215
  • 7
  • 113
  • 145
  • +1. Very well written. I wish I could give you +more than one for that. Thanks again. :) – Victor Zakharov Dec 19 '13 at 20:21
  • The link to the installer from the Notepad++ site sends you to an old version of Xml Tools. You can get the most up-to-date versions and make sure you get x64 or x86 from here: https://sourceforge.net/projects/npp-plugins/files/XML%20Tools/ – HaveSpacesuit Feb 01 '18 at 16:41
0

This is due to the version(x86 vs x64) incompatibility between notepad++ and the xmltools.dll file. The issue is resolved by removing the x86 version of dll and dependencies and downloading the following x64 version of same tool. https://sourceforge.net/projects/npp-plugins/files/XML%20Tools/Xml%20Tools%202.4.9%20Unicode/

Aarush
  • 121
  • 3