静态库

// 相对路径 或者 绝对路径
#include "yourlib.h"

//相对路径 或者 绝对路径
#pragma comment(lib, "yourlib.lib")

int main()
{
    int ret = 0;
       
        // lib里的函数      
        ret = funcInYourLib(int param1);
}

动态库

#include <Windows.h>

typedef int (__stdcall *Func)(int param);

int main()
{
    int ret = 0;

        // 相对路径 或者 绝对路径
    HINSTANCE hdllInst = LoadLibrary("yourDll.dll");  

    Func func=(Func)GetProcAddress(hdllInst,"funcNameInDll");  

    ret = func(0);
}

 

相关文章:

  • 2021-12-27
  • 2022-02-11
  • 2022-01-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-08
  • 2021-06-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-11
  • 2022-12-23
  • 2021-07-27
  • 2021-11-05
相关资源
相似解决方案