VS2019静态/动态库制作 20199321
动态库 #ifndef PCH_H #define PCH_H #include "framework.h" #endif //PCH_H #ifdef IMPORT_DLL #else #define IMPORT_DLL extern "C" _declspec(dllimport) #endif IMPORT_DLL int add(int a, int b); IMPORT_DLL int minus(int a, int b); IMPORT_DLL int multiply(int a, int b); IMPORT_DLL double divide(int a, int b); // dllmain.cpp : 定义 DLL 应用程序的入口点。 #include "pch.h" int add(int a, int b) { return a + b; } int minus(int a, int b) { return a - b; } int multiply(int a, int b) { return a * b; } double divide(int a, int b) { double m = (double)a / b; return m; } // test20199321.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。