运用了MSVC编译器时出现
错误:
👎 error: LNK1158: 无法运行“rc.exe”
解决方法:
找到rc.exe的放置路径,比如C:\Program Files (x86)\Windows Kits\8.1\bin\x86
然后添加到环境变量PATH中,重启Qt即可!
问题二:
D:\QT_stm\home\Public\AdvMotApi.h:128: error: C2065: “HAND”: 未声明的标识
D:\QT_stm\home\Public\AdvMotApi.h:45: error: ‘ULONG’ does not name a type
ULONG Offset;
^~~~~
说明没有包含某些头文件,解决方法:
将MinGW编译器换成MSVC编译器,还要包含stdafx.h文件
然后编译就可以了
问题三:
main.obj👎 error: LNK2019: 无法解析的外部符号 _Acm_DevOpen@8,该符号在函数 _main 中被引用
那么在pro文件上添加外部库
具体的添加方式:
如果编译还出现
则去掉 debug,如下图:
问题四、
编译过程中,如果出现以下问题
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\atlmfc\include\afx.h:24: error: C1189: #error: Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
解决方法:
在StdAfx.h文件中添加
#define _AFXDLL
希望对大家有用