动态库
#include <stdio.h>
#include <string.h>
#pragma comment(lib,"../max/Debug/max.lib")
// 注意这里是 dllimport
#define MAX_IMPORT __declspec(dllimport)
extern int MAX_IMPORT mymax(int a, int b);
int main()
{
return printf("Max %d\n", mymax(50, 8));
}
#include <stdio.h>
#include <string.h>
// 注意这里是 dllexport
#define MAX_EXPORT __declspec(dllexport)
int MAX_EXPORT mymax(int a, int b)
{
return a < b ? b: a;
}