Possible duplicate:
Windows and C ++: extern and __declspec (dllimport)
Why / when __declspec (dllimport) is not required?
I want to write a DLL project. This project includes several DLLs. They are addicted . I define some macros, for example:
#ifdef MYDLL_DECL1
#define DLL_DECL __declspec(dllexport)
#else
#define DLL_DECL __declspec(dllimport)
#endif
I defined MYDLL_DECL1 ... MYDLL_DECLn for each module . Because I thought that if I define the same macro that it will not work. But I really want to define only one macro, and I wrote a test bench. I have two modules. In the second moudle source file. I am writing code like:
#define MYDLL_DECL
#include "moudle1.h"
#include "moudle2.h"
"MYDLL_DECL", modle1 "MYDLL_DECL", "DLL_DECL" "__declspec (dllexport)". 2 "__declspec (dllimport)", module2 import module1. , , . , OpenCV