动态链接库DLL_Sample.dll DLL_Sample.h:#ifdef TEST_API# define TEST_API _declspec(dllexport)#else# define TEST_API _declspec(dllimport)#endif TEST_API int fuc(int a);TEST_API int fuc(int a, int b);TEST_API int fuc(int a, int b, int c);DLL_Sample.cpp:#defin
场景: main函数需要两个接口,一个求和函数,一个打印函数. int sum(int i, int j); 求两个int数字的和. void show(int i, char* name); 打印i的值和它的名称. 现在,需要制作: 一个静态库libcalc.a,提供sum的接口; 一个动态库libshow.so,提供show的接口. #include <stdio.h> #include "calc.h" #include "show.h" int