Frequently asked questions

Q: How can I get xCHM with Unicode support? My chm documents look wrong (I get squares for characters no matter what font face I choose).

A: This is not about xCHM, but about wxWidgets. You need to compile wxWidgets with Unicode support, and then re-configure and build xCHM. You can instruct wxGTK that you want it to use Unicode by issuing:

./configure --enable-gtk2 --enable-unicode

in the root wxGTK source directory.

If you received xCHM as part of a Linux or BSD distribution, you might try to ask your distribution maintainers to provide a Unicode-enabled xCHM package instead of the one you have.

Q: Does xCHM support context-sensitive help?

A: Yes. Eamon Millman has contributed XMLRPC++ code that allows xCHM to act like an XMLRPC server if started with the -x <port> command line flag. The API is detailed in the README.xmlrpc file that you can find in the source tarball. To enable the XMLRPC++ code for xCHM at compile time, you need to run:

./configure --enable-xmlrpc

Make sure you have the XMLRPC++ library installed before trying to enable the XMLRPC code for xCHM.

Q: How do I compile xCHM on Mac OS X?

A: Here's how I did it on Mac OS X 10.5, using XCode 3.1 (do this in a terminal, no superuser access required):

1. Download wxMac, unpack somewhere in your home directory (for example, in /Users/macuser/work/).

2. cd /Users/macuser/work/wxMac-version

3. mkdir build_mac

4. cd build_mac

5. ../configure --enable-unicode --disable-shared --enable-universal_binary --prefix=/Users/macuser/work/wxu

6. make install

7. Download xchm and chmlib, unpack both.

8. Copy lzx.c, lzx.h, chm_lib.c and chm_lib.h to src/ in the xchm directory.

9. Edit xchm's Comment out these lines (like the example):

#AC_CHECK_HEADER(chm_lib.h,,AC_MSG_ERROR([Can't find the CHMLIB header.]))
# chm, chm_open,,
# AC_MSG_ERROR([Can't find/use -lchm. Please install CHMLIB first.])

And modify the CFLAGS and CXXFLAGS thus:

CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY -W -Wall -arch ppc -arch i386"
CFLAGS="$CFLAGS $WX_CFLAGS_ONLY -arch ppc -arch i386"

The above change adds "-arch ppc -arch i386" to both CFLAGS and CXXFLAGS, which is important for building a Mac Universal binary.

10. Edit xchm's src/ file and add "lzx.c chm_lib.c" to xchm_SOURCES, then add "lzx.h chm_lib.h" to noinst_HEADERS.

11. From the xchm root directory, run 'autoreconf'.

12. Again from the xchm root directory, run:

./configure --enable-optimize --enable-debug=no --disable-dependency-tracking --with-wx-config=/Users/macuser/work/wxu/bin/wx-config

13. Run 'make'.

14. At this point, you should have the xchm binary in xchm/src/. Proceed to add it to a DMG bundle using the Makefile provided here:

Q: Why doesn't xCHM work well with my file? Will you correct the problem?

A: Please take a look at the 'Limitations' section on the technical notes page. If your problem is listed there, then the answer is no, I will probably not fix the problem. xCHM is but a humble front-end for chmlib, and it's not meant for reading Windows help. Use hh.exe to read Windows help. Of course, if you're set on writing a good patch I'll have a look.

Q: What do I do if I get an "error while loading shared libraries" message after compiling xCHM?

A: The short answer is: run ldconfig as root. The long answer is on the forum.

Q: xCHM displays the HTML source code of the pages instead of properly rendering it. Can I fix this?

A: That depends. The problem might be that an application such as Crossover Office has already registered the .chm extension in your ~/.mime.types file. Most likely that can be solved by commenting out the relevant lines (this solution has been received from Marcelo Fernandez).


If none of the above answers your question, you might try the SourceForge help forum for xCHM. Please see if someone else already answered your question before posting.

Get xCHM at Fast, secure and Free Open Source software downloads Support This Project