When building against static Cap'n Proto libraries, mpgen compilation fails at link time as libcapnpc.a depends on symbols defined in libcapnp.a.
Flipping the order fixes the undefined references.
I ran into this issue when compiling Bitcoin Core with IPC enabled in a Ubuntu/Debian container to produce self-contained binaries that can be extracted to a host.