W8122 dllexport class member '%s' should be of exported type (C++)

From RAD Studio
Jump to: navigation, search

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

This message occurs when calling a member function from a class that is not declared as __declspec(dllexport).

  class ExampleClass
  {
      public:
            int foo(){};
            double __declspec(dllexport) foo(int){};
  };
  int main(int, char** )
  {
     int someint;
     ExampleClass x;
     x.foo(); //Warning
     x.foo(someint); // Ok
  }