Home > Back-end >  How to encapsulate a class to the DLL C?
How to encapsulate a class to the DLL C?

Time:09-20

I am now so write:

 
//the header file
The class _declspec (dllexport) ConfigurationFile {
.
};

Other didn't modify and compile generate DLL,
Then call the header files changed:
 
The class _declspec (dllimport) ConfigurationFile {
.
};

But call will go wrong, the interruption,
How should change?

CodePudding user response:

Change the header file do=,=

CodePudding user response:

reference 1st floor u010370871 response:
header file instead do=,=

That should be how to change?

CodePudding user response:

In the MSDN search "Using Dynamic Link Libraries -"

CodePudding user response:

http://www.cnblogs.com/cswuyg/archive/2011/10/06/DLL2.html

CodePudding user response:

http://blog.csdn.net/flyoxs/article/details/5538040

CodePudding user response:

Add you generate DLL to the debug directory (yes. Exe file directory), the lib files are added to the engineering (engineering file right click - "add -" existing items - "find your.lib file -" add),. H file also need to add to the program running directory (not the debug directory, is your project directory where h file with the CPP files), running with respect to ok

CodePudding user response:

Above said leakage,. H file is added to the program is running is need to modify the directory, such as class _declspec (dllimport) ConfigurationFile {... };
Purpose is to make _declspec (dllexport) instead of _declspec (dllimport)

CodePudding user response:

Add you generate DLL to the debug directory (yes. Exe file directory), the lib files are added to the engineering (engineering file right click - "add -" existing items - "find your.lib file -" add)
  • Related