How to port NEdit on MS Windows:
The aim of this page is to provide basic information on
how to port NEdit to Windows, where porting means compiling from sources
Notice, that there is no need to read this, if you only want to run NEdit on MS Windows. In this case all you need is an X server and to download the installation package. The information given here is useful, if you need to, or want to, compile NEdit from its sources yourself. So, this text is somewhat more directed to the expert.
To start with, the NEdit port under Microsoft Windows is not a native port in the Windows environment. NEdit doesn't use the Windows GUI API. If you think, only native ports are the real things, please notice that this port gives you one advantage: NEdit will be exactly the same as it is on Unix. There is not the slightest difference whatsoever between this NEdit port and an NEdit binary on Unix (linked to LessTif, since this port must be linked to LessTif because of a license issue).
Requirements for Porting
The Cygwin environment:
The Cygwin project consists in porting the GNU tools and utilities to Windows.
The Cygwin library provides a UNIX-like API on top of the Win32 API.
Go to the cygwin site in order to read more and to download it from one of their ftp mirrors. Notice, that the installation process is automated. I don't explain it further, because this might be due to changes. You don't need everything from Cygwin, but make sure, that you get at least all the tools described at Build & Install. Moreover, in order to run NEdit in a fully functional way, you need to get
X libraries and headers:
In order to compile NEdit, you only need the X libraries and headers. I have
put up them here. These are part of the
Xfree port for Cygwin, which is included in
the Cygwin distribution. This means you can also install these libraries and
headers from Cygwin. Notice that for running NEdit you will need an X
server for Windows. You can use any working X server. Here is a link for
almost all about X.
If you want to run the Xfree server, you have to install it with Cygwin. In this case make sure to get the headers of the X libraries. Since they are not required for running applications, they are usually in an optional package.
Although it will take some time, I recommend to get the LessTif sources and
build them with
make. Although you
may find LessTif packages pre-built for Cygwin, it may not be clear with
what Cygwin and Xfree libraries they were built, so it is safer to build it
yourself. Notice that there have been some incompatibilities between NEdit
and LessTif in the past. Moreover, you can never know what happens tomorrow,
so read about what Lesstif version is good for
NEdit, first! Then, go to the download page and also check out the building
requirements at the LessTif pages.
If you have installed the above packages on your system, you are ready for compiling.
When installing Cygwin, a home directory is set up for you, where you logon when
you invoke bash. Get the NEdit
sources and unpack them
to this directory for compiling. Before compiling, you have to edit
Makefile.cygwin in the makefiles folder appropriately. To make it
easy, here is an example. Moreover, you may consider
to change the default names for NEdit's preference file and the default shell, see
Now you are ready to invoke bash and to cd to the NEdit folder. Then simply type in
make cygwin, that's all.
For more detailed information about compiling NEdit, cf. Build & Install.
After compiling, you have the two binaries
nc.exe is the so-called NEdit client.
It is advisable to run NEdit through this client. First, move these binaries to
/usr/X11R6/bin folder. Before running NEdit, some environment
variables have to be set. Although this variables could be set globally, I set
them locally in a start up script. For a better integration into Windows, e.g.,
assigning file extensions to NEdit, you will have to use this
script. Read it for details, you may need the file
XKeysymDB, too. In order to assign NEdit to file extension,
use the command (omitting path names):
If you want to send unassociated files to NEdit, here is a batch file (needs the above script) that you can make a link to from your send-to folder.
If you have already installed Cygwin, in order to run NEdit, all you need are the
X libraries (without the headers) and an X server. There are
binaries provided at
NEdit.org. Notice, that it may cause problems, when the
Cygwin1.dll, that you are using, doesn't match the version to which the provided binaries are (necessarily) dynamically linked. Normally, it should work, when the version difference isn't too large, but no guarantee from me. (Only one reason for providing an installation package containing everything.)
- What only using NEdit is concerned, there is no difference between a fully working Cygwin environment and the installation package provided.
Notice, that setting the X resources depends on the X server you use. There
are X servers that read files like
.Xresources. If your server does not, you can rename the NEdit preference file in
.neditto something else. Then you can try to set the X defaults for NEdit in the file
To use the shell commands, notice that standardly, NEdit tries to invoke
the C shell (
csh). This shell is not provided by Cygwin, and if you invoke a shell command and the specified shell is not found, under Cygwin NEdit is likely to hang up with an X lib sync error. So, make sure that the specified shell is found. You can specify one with the X resource
nedit.shell: /bin/tcsh, or you can set the default value directly in the sources before compiling. To be fully functional, I recommend to install and use
tcsh. Of course, you can use
sh(really ash) or bash, too, but notice that you cannot spawn daemons with it.
Notice, that in order to run NEdit through nc.exe, which is recommended,
you need to install ash (
Great thanks goes to Christian Denat, long-time webmaster of NEdit.org, who started this NEdit port. Without his idea and effort the whole stuff wouldn't be here.