문제

I converted my C++ dll to C dll:

#ifdef __cplusplus
    extern "C" {
#endif

MY_EXPORT int  my_func();
MY_EXPORT void my_func(int n);

#ifdef __cplusplus
    }
#endif

Everything worked fine without extern C declaration. With this declaration I got

error C2733: second C linkage of overloaded function 'my_func' not allowed

Why is it not allowed to export overloaded functions from C-style dll ?

도움이 되었습니까?

해결책

C does not allow to overload functions. That is C does not support overloading. It is a feature of C++.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top