How about using a C/C++ compiler to first build the library and then link to it like a normal dll/so?