I'm not sure this is relevant to Nim unless you want to go C++ --> Nim --> C.
You can use LLVM for that.
See also the official C++ FAQ