0

I'm beginning with QLibrary, in this context I've reached the Stack Overflow question "QLibrary - import a class". And I have a question about that question:

What the meaning of TESTDLL_LIBSHARED_EXPORT in the class declaration?

class TESTDLL_LIBSHARED_EXPORT TestDLL_lib
{

public:
    TestDLL_lib();

    int a;
    int b;
    int c;

    int getValues();
}; 
Community
  • 1
  • 1
KcFnMi
  • 5,516
  • 10
  • 62
  • 136

1 Answers1

0

Please refer to How to use a class in DLL? for detail answer.

you can export data, functions, classes, or class member functions from a DLL using the __declspec(dllexport) keyword. __declspec(dllexport) adds the export directive to the object file so you do not need to use a .def file. To export all of the public data members and member functions in a class, the keyword must appear to the left of the class name as follows:

class TESTDLL_LIBSHARED_EXPORT TestDLL_lib
Community
  • 1
  • 1
user258367
  • 3,247
  • 2
  • 18
  • 17