将其原始项目档案作为的复印件 CoreLib.vcxproj (如果是其他甚小公司,则检查遗嘱延期。)
Add CoreLib.vcxproj, as a existing project to You Solutions and Save the You Solutions.
Go to the properties->Configuration Property-> General of CoreLib。
选择all Configurations(左上角)。
更改财产 结构类型至static Library。
更改财产Target extension至.lib。
Append to property Intermediate Chefy for example Lib.
Go to the properties->Configuration Property->C/C++->Preporcessor
选择Debug Configuration(左上角)。
现将财产Preprocessor Defins ,并将_USRDL改为_USRLIB
选择Release Configuration(左上角)。
现将财产Preprocessor Defins ,并将_USRDL改为_USRLIB
In your header-file you should have something like the following:
#ifdef MyDll_EXPORTS
#define MyDll_API __declspec(dllexport)
#else
#define MyDll_API __declspec(dllimport)
#endif
修改如下:
#ifdef MyDll_EXPORTS
#ifdef _USRLIB
#define MyDll_API
#else
#define MyDll_API __declspec(dllexport)
#endif
#else
// Here must deploy your own logic whether static or dynamic linking is used.
// read my comment below
#define MyDll_API __declspec(dllimport)
#endif
您 建设能产生原样和进口平衡以及新的静态平衡!