Yes, it does work on Windows. Not anywhere else.
Which makes it a compiler issue, not a language one.
Then again, most other platforms never were too C++ friendly and rather lean on C.
BeOS, Symbian, Genode and Windows are probably the only OSes that give C++ some love.
You just need to declspec(dllexport) the classes, with the caveat that thanks to the lack of standard ABI you need the same compiler on both sides.