E2568 Illegal initialization of function '%s' (C++)

From RAD Studio
Jump to: navigation, search

Go Up to Compiler Errors And Warnings (C++) Index

This occurs when a function is not defined properly in a DLL.

        typedef int (tfun)(int);
        struct S {
            tfun p_;
            S(const tfun& p) : p_(p) {} // error: function used as initializer
        };
        void n(const tfun& p) {
            new S(p);
        }