Name mangling of c++ classes and its member functions?

后端 未结 4 1098
失恋的感觉
失恋的感觉 2021-01-21 01:15

Is there no way I could avoid name mangling of C++ classes and its member functions when exposed from a c++ dll.

Can\'t I use a def file mechanism in this regard ?

4条回答
  •  执笔经年
    2021-01-21 02:00

    I don't believe so. Name mangling is used so that each overloaded function has a different name as viewed by the linker.

    You could rewrite them in C and use the extern "C" {} construct but then you lose all your beautiful inheritance, polymorphism and so forth. You could also wrap the C++ inside C functions and expose only the C functions.

提交回复
热议问题