Using dllimport in place of dllexport
问题 I seem to be able to use __declspec(dllexport) and __declspec(dllimport) interchangeably when building my dll in Visual Studio 2015. I would have thought when making the DLL that the dllexport command would have been required but it seems either dllexport or dllimport is adequate.I have the following header file declaring a simple add() functions: add.h #pragma once #ifdef ADDDLL_EXPORTS #define ADDDLL_API __declspec(dllexport) #else #define ADDDLL_API __declspec(dllimport) #endif ADDDLL_API