A C++ implementation for interpreting MDX/MDD dictionary files. This library provides functionality to read and parse MDX/MDD dictionary files commonly used in electronic dictionaries.
git clone git@github.com:dictlab/mdict-cpp.git
cd mdict-cpp
git submodule init
git submodule update --recursive
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .
# additionally if you want a single static file:
$ cmake --build . --target mdict-fat
To install the library system-wide (requires root privileges):
mkdir build
cd build
cmake -DINSTALL_TO_SYSTEM=ON ..
make
sudo make install
it will install those files:
-- Installing: /usr/local/lib/libmdict.a
-- Installing: /usr/local/lib/libmdictminiz.a
-- Installing: /usr/local/lib/libmdictbase64.a
-- Up-to-date: /usr/local/include/mdict/mdict.h
-- Up-to-date: /usr/local/include/mdict/mdict_extern.h
-- Installing: /usr/local/bin/mydict
This will install:
/usr/lib (Linux) or /usr/local/lib (macOS/BSD)/usr/include (Linux) or /usr/local/include (macOS/BSD)mkdir build
cd build
cmake ..
make mydict
The executable will be generated at build/bin/mydict
Warning: Make sure to include backslashs at the end of each query, otherwise lookup can fail.
./build/bin/mydict your_mdx_file.mdx yourword
# output the resource binary as base64 format
./build/bin/mydict your_mdx_file.mdd \\xxx\\xx.png
# output the resource binary as hex string format
./build/bin/mydict -x your_mdx_file.mdd \\xxx\\xx.png
./build/bin/mydict -l your_mdx_file.mdx
./build/bin/mydict -l your_mdx_file.mdd
mkdir build
cd build
cmake ..
make mdict
The library will be generated at target/lib/libmdict.a
#include "mdict_extern.h"
target_link_libraries(your_project mdict)
# after make install
cd src
g++ -std=c++17 -I/usr/local/ -I. -L/usr/local/lib -lmdict -lmdictminiz -lmdictbase64 mydict.cc -o mmdict
The MDX/MDD file format is a dictionary format commonly used in electronic dictionaries. MDX files contain the dictionary content (text, HTML, etc.), while MDD files contain associated resources (images, audio, etc.).

Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the BSD-3-Clause License - see the LICENSE file for details.
C++
79.6%
C
12.5%
CMake
7.1%
A C++ implementation for interpreting MDX/MDD dictionary files. This library provides functionality to read and parse MDX/MDD dictionary files commonly used in electronic dictionaries.
git clone git@github.com:dictlab/mdict-cpp.git
cd mdict-cpp
git submodule init
git submodule update --recursive
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .
# additionally if you want a single static file:
$ cmake --build . --target mdict-fat
To install the library system-wide (requires root privileges):
mkdir build
cd build
cmake -DINSTALL_TO_SYSTEM=ON ..
make
sudo make install
it will install those files:
-- Installing: /usr/local/lib/libmdict.a
-- Installing: /usr/local/lib/libmdictminiz.a
-- Installing: /usr/local/lib/libmdictbase64.a
-- Up-to-date: /usr/local/include/mdict/mdict.h
-- Up-to-date: /usr/local/include/mdict/mdict_extern.h
-- Installing: /usr/local/bin/mydict
This will install:
/usr/lib (Linux) or /usr/local/lib (macOS/BSD)/usr/include (Linux) or /usr/local/include (macOS/BSD)mkdir build
cd build
cmake ..
make mydict
The executable will be generated at build/bin/mydict
Warning: Make sure to include backslashs at the end of each query, otherwise lookup can fail.
./build/bin/mydict your_mdx_file.mdx yourword
# output the resource binary as base64 format
./build/bin/mydict your_mdx_file.mdd \\xxx\\xx.png
# output the resource binary as hex string format
./build/bin/mydict -x your_mdx_file.mdd \\xxx\\xx.png
./build/bin/mydict -l your_mdx_file.mdx
./build/bin/mydict -l your_mdx_file.mdd
mkdir build
cd build
cmake ..
make mdict
The library will be generated at target/lib/libmdict.a
#include "mdict_extern.h"
target_link_libraries(your_project mdict)
# after make install
cd src
g++ -std=c++17 -I/usr/local/ -I. -L/usr/local/lib -lmdict -lmdictminiz -lmdictbase64 mydict.cc -o mmdict
The MDX/MDD file format is a dictionary format commonly used in electronic dictionaries. MDX files contain the dictionary content (text, HTML, etc.), while MDD files contain associated resources (images, audio, etc.).

Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the BSD-3-Clause License - see the LICENSE file for details.
C++
79.6%
C
12.5%
CMake
7.1%