Compiling Registro.br lib-EPP and Xerces-C on Linux: C++ Toolchain, Dependencies, and Troubleshooting
Back to blog

Compiling Registro.br lib-EPP and Xerces-C on Linux: C++ Toolchain, Dependencies, and Troubleshooting

6/7/2026 · 3 min · Infrastructure

1. Technical Context and EPP Architecture#

The libepp-nicbr library implements the EPP protocol for essential operations such as:

In my scenario, this library was a critical requirement for automating domain provisioning within an internal operational workflow.

2. Preparing the C++ Toolchain and Minimum System Dependencies#

Debian/ubuntu#

sudo apt update
sudo apt install -y build-essential libssl-dev libreadline-dev libncurses5-dev libcppunit-dev pkg-config doxygen

Rhel/centos/rocky Linux#

yum groupinstall -y "Development Tools"
yum install -y xerces-c-devel openssl-devel readline-devel ncurses-devel cppunit-devel pkgconfig doxygen

3. Surgical Compilation and Installation of Xerces-C 3.2.5#

Downloading and Verifying Xerces-C#

cd /usr/local/src
wget http://archive.apache.org/dist/xerces/c/3/sources/xerces-c-3.2.5.tar.bz2
tar -xjvf xerces-c-3.2.5.tar.bz2
cd xerces-c-3.2.5

If your environment requires rigid security controls, always validate the package checksum before proceeding to compilation.

Configuring the Xerces-C Build#

./configure

During the configure phase, I specifically look for:

Building and Installing into System Paths#

make -j"$(nproc)"
make install
make doc
ldconfig

Note: make doc is optional for runtime execution but highly recommended for engineering and reference environments.

4. Shared Library Validation for Xerces-C and ldconfig#

  1. Validate whether the library was correctly registered in the system cache:
ldconfig -p | grep -i xerces
  1. Validate the header file path:
find /usr/local/include -iname '*xerces*' | head
  1. Validate pkg-config functionality (if applicable):
pkg-config --cflags --libs xerces-c || true

5. Downloading and Configuring Registro.br lib-EPP#

Downloading Source Code#

cd /usr/local/src
wget -O libepp.tar.gz https://ftp.registro.br/pub/libepp-nicbr/libepp-nicbr-1.20_1.tar.gz
tar -xvf libepp.tar.gz
cd libepp-*

Configuring Build with Xerces-C Bindings#

Initial standard execution:

./configure

If the environment is fully integral, proceed to compilation. If any "header not found" errors occur, do not attempt to force make; resolve the underlying dependency issues first.

6. Building and Installing lib-EPP with Modern C++ Toolchains#

make -j"$(nproc)"
make install
make doc

Once installed, ensure the system library cache is updated:

ldconfig

7. Real-World Troubleshooting: Broken Readline Detection and XML Symbols#

In my specific case, the configure script reported:

checking for /usr/include/readline/readline/readline.h ... no
checking for /usr/include/readline/readline/history.h ... no

Despite readline being correctly installed on the host:

find /usr/include -name readline.h
# Found at: /usr/include/readline/readline.h

The root cause was a mismatch in the directory structure expected by the library's build script.

Applied correction#

ln -s /usr/include/readline /usr/include/readline/readline
ln -s /usr/include/readline /usr/include/readline/history

./configure --with-readline-includes=/usr/include/readline

Expected validation after the fix:

checking for /usr/include/readline/readline/readline.h ... yes
checking for /usr/include/readline/readline/history.h ... yes

Common Xerces-C Linker Pitfalls#

configure succeeds, but make fails during linking#

Common Cause: Duplicate libraries existing between /usr/lib and /usr/local/lib.

Action: Review LD_LIBRARY_PATH, check ldconfig outputs, and perform a clean build after removing stale artifacts.

Headers located in unexpected paths#

Common Cause: The distribution utilizes a filesystem layout different from what the consumer project expects.

Action: Standardize the include path within the dependent project's configuration rather than "forcing" manual header copies.

Insufficient permissions in installation directories#

Symptom: make install fails with a Permission denied error.

Practical Action:

sudo make install
sudo ldconfig

If the build process was executed as a standard user, maintain the compilation without elevated privileges and elevate only during the installation step.

8. Functional Validation with the Interactive shepp Shell#

Final validation is not merely a successful make exit code. I test the shepp shell client to confirm the entire linking chain is integral and operational:

shepp

Expected output:

Welcome to shepp version 1.25, an EPP shell client!
Type: 'help' for available commands.
shepp:

If shepp fails to launch, immediately review LD_LIBRARY_PATH and the output of ldconfig -p.

9. Operational Hardening, Permissions, and Production Practices#

For production environments, I strongly recommend:

Governance of Hand-Compiled Libraries#

10. Post-Build Technical Homologation Checklist#

  1. Validate the binary location:
which shepp
  1. Validate dynamically loaded libraries:
ldd "$(which shepp)"
  1. Record the compiled version for future auditing:
shepp --version || shepp <<<'quit'
  1. Archive the configure and make outputs in your internal change logs.

Strategic Takeaways and Next Steps#

Compiling libepp-nicbr is a straightforward task when the C/C++ environment is coherent, but it becomes notoriously unstable when include paths diverge between the OS distribution and the build scripts. The definitive resolution in my case involved addressing the readline path resolution prior to running make, validating the result with shepp, and documenting the outcome as a standardized operational procedure.

Was this article helpful?

Leave a quick reaction to help prioritize future technical guides:

CC BY-NC

This post is licensed under CC BY-NC.

Comments

Join the discussion below.

0 comments