Reputation: 95
DLL Library:
// export.h
#if defined(COMMON_EXPORT)
#define COMMON_DLL __declspec(dllexport)
#else
#define COMMON_DLL __declspec(dllimport)
#endif
// foo.h
class COMMON_DLL Foo
{
int foo() { return 1; }
}
if i try to invoke this code from other library, then linker error happened. If remove COMMON_DLL from foo.h or move implementation of foo() method to .cpp file, then all work fine. Why is it so?
Upvotes: 0
Views: 860