Cyapi 在QT下的引用

不保证我的方法是准确的,因为现在还没有调试完成

更不保证是最合理的。主要是给自己记录下,如果对大家有参考作用,那是意外了。

1.CyAPI.lib

2.User32.lib

3.SetupAPI.lib

4.legacy_stdio_definitions.lib

注意第四个的路径不一样。

还要加上,两个文件包含有先后顺序

#include //其实就是包含#include ,为了识别windows的类库

#include "CyAPI.h"


#pragma comment(lib,"User32.lib")

我的Cyapi.pro文件增加的如下:


win32:!win32-g++: PRE_TARGETDEPS += $$PWD/./
else:win32-g++: PRE_TARGETDEPS += $$PWD/./libCyAPI.a


INCLUDEPATH += $$PWD/'../../../../Program Files (x86)/Windows Kits/10/Lib/10.0.17763.0/um/x64'
DEPENDPATH += $$PWD/'../../../../Program Files (x86)/Windows Kits/10/Lib/10.0.17763.0/um/x64'
INCLUDEPATH += $$PWD/'../../../../Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/lib/x64'
DEPENDPATH += $$PWD/'../../../../Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/lib/x64'

win32: LIBS += -L$$PWD/'../../../../Program Files (x86)/Windows Kits/10/Lib/10.0.17763.0/um/x64/' -lUser32
win32: LIBS += -L$$PWD/'../../../../Program Files (x86)/Windows Kits/10/Lib/10.0.17763.0/um/x64/' -lSetupAPI
win32: LIBS += -L$$PWD/'../../../../Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/lib/x64/' -llegacy_stdio_definitions
win32:!win32-g++: PRE_TARGETDEPS += $$PWD/'../../../../Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/lib/x64/legacy_stdio_definitions.lib'
else:win32-g++: PRE_TARGETDEPS += $$PWD/'../../../../Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/lib/x64/liblegacy_stdio_definitions.a'
 

你可能感兴趣的:(Cyapi 在QT下的引用)