For Chinese word segmentation, people usually go with the ICTCLAS module; while it’s far from perfect, it’s still a decent choice.

It provides Windows and Linux versions and supports C/C#/JNI interfaces. That should be a good thing, but with so many versions, the official team seems to have trouble keeping up.

After invoking its .so file under Linux, it reports an error like this:

Bash
Exception in thread "main" java.lang.UnsatisfiedLinkError: /..../libICTCLAS50.so: 
libstdc++.so.5: cannot open shared object file: No such file or directory

The reason is simple: the version is wrong. The C++ library used by ICTCLAS is far older than the stdc++ library you normally use, so they are incompatible. To fix this, we need to install an older version specifically for it.

The Fedora distribution makes this relatively easy.

libstdc++.so.5 is part of the compat-libstdc++-33 package. From this address you can find some mirrors; just pick one, download the RPM package, and install it.

Of course, yum can solve this even more easily:

Bash
# yum install compat-libstdc++-33

Note: In this Stack Overflow Q&A, someone suggested using this command:

Bash
# yum install 'libstdc++.so.5'

This trick may work in some cases, and it works on i386/i686 systems, but it actually does not work in an x64 environment.

That’s because it will find compat-libstdc++-33.i686 and install it. The result is that the required .so appears in lib/, but it is not installed in the more important lib64/.

For other distributions, you should also be able to find usable packages in the software repository.

If all else fails, good luck... libstdc++.so.5 is something that shipped with GCC 3.3, so you may need to try compiling GCC 3.

Here is a download source: http://packages.debian.org/stable/base/libstdc++5

Download that .tar.gz package and compile it yourself.

Of course, there should be better ways, although I don’t know them.