A lot of people on the SciTE mailing list (and probably other text editors
groups too) have been clamoring for a spell-checker to work with their
favorite editor. I thought if I could find a decent C/C++ library that
handled spelling, I could write some code to output the results in a format
similar to the error messages from the gnu C/C++ and mingw C/C++ compilers.
When I found out aspell had such a library, I decided to download a copy of
the latest version 0.60.6 and test out my idea. As I was trying to compile
the library with mingw and msys, I kept asking myself how did anyone get
this working on Windows. After searching the Internet for 4 fixes to
various issues I came across, I finally got the library and aspell program
to build. I went back to the aspell web site to locate some documentation
on the C/C++ library API and I noticed the Win32 page doesn't have the
latest version of aspell. So, I guess people aren't getting this to compile
on Windows.
I have some diffs to get aspell 0.60.6 compiling properly with mingw and
msys. I also have a request for an additional program that I would really
like to see added to the examples directory. I cannibalized the example-c.c
code to come up with something that would spell check a file and output
results to stdout in the error format used by gnu gcc. I think this or
something like it would be a really useful example to add for anyone who's
been wanting to run aspell with a decent programming editor. Hopefully
others could help contribute and make it a better and more robust program,
since the changes I made were quick ones just to get proof of concept.
The diffs for aspell on mingw with msys are included below. I also have
some Windows executables. I have library files in .a format, but
the ./configure, make, make install process doesn't appear to have created
any dlls. I don't remember having any problems installing the English
dictionary files using the ./configure, make, make install process under
msys. If you need executable files and/or library (.a files) packaged a
certain way, let me know and I can send them to someone if they want to
distribute them further. The source code I wrote for better integrating
aspell with a programming editor is at:
http://www.distasis.com/cpp/aspellstdout.c
It can be compiled with mingw using the command:
g++ -o aspellstdout.exe aspellstdout.c -I\mingw\msys\local\include -L
\mingw\msys\lib -L \mingw\msys\local\lib -ldl -laspell -lintl -
lgettextlib.dll -ldl.dll
I also compiled it on DeLi Linux using the command:
g++ -o aspellstdout aspellstdout.c -I/usr/local/include -L /usr/lib -
L /usr/local/lib -ldl -laspell -lintl
On Windows, I'm using the basic libraries such as libiconv and libintl from
the GnuWin32 project, http://sourceforge.net/project/gnuwin32 I'm using the
libdl library from:
http://code.google.com/p/dlfcn-win32/downloads/list
Be sure to add the patch for extern C on the issues page. That was one of
the fixes I needed to make to get things to compile. I'm using the latest
copy of pdcurses from Sourceforge: http://sourceforge.net/project/pdcurses
Don't know if it's needed, but I have my .profile file (used by msys) set up
as mentioned here: http://www.distasis.com/cpp/mingw.htm#whatismsys
The examples in the example directory didn't compile when I used the
makefile. Was able to get example-c to compile from command line in a
standard command prompt with the following command:
g++ -o example-c.exe example-c.c -I\mingw\msys\local\include -L
\mingw\msys\lib -L \mingw\msys\local\lib -ldl -laspell -lintl -
lgettextlib.dll -ldl.dll
To run the example-c.exe afterwards, you need libdl.dll, libicon2.dll,
libintl3.dll in the same directory or in the path.
Here are the patches I needed for mingw and msys:
\mingw\msys\bin\diff \mingw\msys\home\old\aspell-0.60.6\common\config.hpp
\mingw\msys\home\new\aspell-0.60.6\common\config.hpp
15a16,19
#ifdef __MINGW32__
#define libintl_printf printf
#endif
\mingw\msys\bin\diff \mingw\msys\home\old\aspell-0.60.6\common\file
_util.cpp \mingw\msys\home\new\aspell-0.60.6\common\file_util.cpp
15a16
#include "asc_ctype.hpp"
\mingw\msys\bin\diff \mingw\msys\home\old\aspell-0.60.6
\modules\speller\default\language.cpp \mingw\msys\home\michaelsl\new\aspell-
0.60.6\modules\spell
er\default\language.cpp
23d22
< #ifndef __MINGW32__
26d24
< #endif
Best wishes.
Laura