If you can't explain it simply,

you don't understand it well enough.

Qt引入动态链接库

本次研究中需要导入三个外部文件:

  • 动态链接库
  • 驱动器配置文件(简单)
  • 运动程序(简单)

     

  1. VC的引用库文件为xxx.lib,把xxx.dllxxx.libxxx.h复制到Qtproject下,动态链接库拷贝到输出文件夹debug或者release中。
  2. Qt.pro件中最后面加上:

    LIBS += -L. lxxx //增加当前目录下的xxx.dll

    e.g. win32: LIBS+="D:/QT_programer/BioSpiderRobot1226/gts.dll"

  3. Qt的头文件中添加xxx.h
  4. #include <QLibrary>

    #include "gts.h"

    QLibrarydll("gts.dll");

    if(dll.load())//检验是否下载成功

    {printf("Successful!!!\n");

    }

    else

    {printf("Default!!!\n");

    }

posted @ 2019-05-06 21:39  赵小亮  阅读(4161)  评论(0编辑  收藏  举报


Though the night was made for loving,
and the day returns too soon,
yet we'll go no more a-roving
by the light of the moon.