A core feature of Visual Studio that allows developers to inspect, analyze, and troubleshoot code during execution.
@hitbuyi You have totally missed the purpose of the conditional compilation statements
#ifdef TESTDLLINT_EXPORTS
#define TESTDLLINT_API __declspec(dllexport)
#else
#define TESTDLLINT_API __declspec(dllimport)
#endif
In your DLL project in which TESTDLLINT_EXPORTS is defined the preprocessor resolves TESTDLLINT_API to __declspec(dllexport).
In other projects that consume the dll and for which TESTDLLINT_EXPORTS is NOT defined the preprocessor resolves TESTDLLINT_API to __declspec(dllimport).
So the header that declares exported classes, functions and variables should use TESTDLLINT_API, instead of __declspec(dllexport).
For example,
class TESTDLLINT_API CtestDLLint {
public:
CtestDLLint(void);
public:
int m;
};
extern TESTDLLINT_API int myInt;
extern TESTDLLINT_API CtestDLLint myInst;
So the same header can be used for the DLL project and other projects that consume DLL exports.