Different behaviours in Linux and MacOs with Julia embedded in C++

This is exactly what I ended up doing, and it works. It is not the most elegant solution, but at least it is something working both on MacOS and Linux.