I'm programming a project where I use multivariate symbolic polynomials. At some point I need to perform a PolynomialMod over a prime modulus, but the library GiNaC which I use works only over the Reals so has no finite field arithmetic implemented.
As I always program on Mathematica before going on C/C++ I know that the desired result can be achieved using Mathematica. Then I'm thinking on linking C++ with Mathematica.
I only need calling an own-coded Mathematica function, send arguments and receive an output that defines the desired polynomial over $F_p$.
In the end I see two options: find a library compatible with C++ that makes multivariate symbolic polynomial arithmetic over $F_p$ (which is not existant IMO) or just use Mathematica as it works flawlessly.
In the case of using Mathematica, which is the way to go? I've seen https://reference.wolfram.com/language/CCodeGenerator/tutorial/CodeGeneration.html#139183296 as the CodeGeneration tool that translates Wolfram Language to C++. Others says to use pure C embedding, loading the core of Mathematica, then calling your own custom function, but I need concrete examples or documentation that helps me to pass through this.
TL;DR
What I want: calling a custom Mathematica function that accepts $5$ arguments and returns a polynomial modulo an irreducible polynomial over $F_p$.
What I have: The own custom function works well inside a notebook.
What I don't have: I don't know how to link that own custom function with my C++ code. Must rely on Mathematica as there is no library compatible with C++ that satisfy my needs.