Window-安装qt-MVSC2013编译器
参考:
https://blog.csdn.net/star_of_science/article/details/103643259
https://blog.csdn.net/qq_35768238/article/details/80312770
首先安装VS2013:
vs2013.5_pro_chs.iso
然后安装qt
这里我们先随便选一个版本:
http://download.qt.io/archive/qt/5.13/5.13.2/
因为这个版本不一定有MVSC2013版本,或者你直接下载一个有MSVC2013的:
qt-opensource-windows-x86-msvc2013_64-5.8.0.exe(强烈建议直接安装这个)
但是我选择了没有MVSC2013版本的,练习一下步骤
这是别人的图,我当时只选择安装了红箭头指向的
然后找到安装路径下的:
MaintenanceTool.exe
选择设置:
清华大学的开源镜像站
https://mirrors.tuna.tsinghua.edu.cn/qt/online/qt5/windows/x86/online_repository/
红色箭头是原本安装的,红色圈出的是刚刚选择的:
然后会下载圈出的那部分进行安装
这里其实和直接安装qt-opensource-windows-x86-msvc2013_64-5.8.0.exe
效果一样,但是为了学习一下才这么折腾下
正在下载和安装MSVC2013
1.找不到opencv的头文件,或者库文件Qt编译出错Error in " Util.asciify("build-helloworld-Desktop_Qt_5_6_1_MinGW_32bit-Debug")
我的pro如下:
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
main.cpp \
mainwindow.cpp \
saveframe.cpp \
grabframe.cpp \
phoio.cpp
HEADERS += \
mainwindow.h \
saveframe.h \
grabframe.h \
qphoframe.h \
phoio.h
FORMS += \
mainwindow.ui
RESOURCES +=
INCLUDEPATH += $$PWD/../3rdParty_msvc2013/opencv-3.1.0/include
INCLUDEPATH += $$PWD/../3rdParty_msvc2013/libtiff-4.0.10/include
INCLUDEPATH += "C:/Program Files/PhotoneoPhoXiControl/API/include"
DEPENDPATH += $$PWD/../3rdParty_msvc2013/opencv-3.1.0/include
DEPENDPATH += $$PWD/../3rdParty_msvc2013/libtiff-4.0.10/include
DEPENDPATH += "C:/Program Files/PhotoneoPhoXiControl/API/include"
# opencv
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../3rdParty_msvc2013/opencv-3.1.0/x64/vc12/lib/ -lopencv_core310 -lopencv_imgcodecs310 -lopencv_imgproc310
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../3rdParty_msvc2013/opencv-3.1.0/x64/vc12/lib/ -lopencv_core310-gd -lopencv_imgcodecs310-gd -lopencv_imgproc310-gd
# tiff
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../3rdParty_msvc2013/libtiff-4.0.10/lib/ -ltiff
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../3rdParty_msvc2013/libtiff-4.0.10/lib/ -ltiffd
# PhoXi API
win32:CONFIG(release, debug|release): LIBS += -L$$(PHOXI_CONTROL_PATH)/API/lib/ -lPhoXi_API_msvc12_Release_1.2.14
else:win32:CONFIG(debug, debug|release): LIBS += -L$$(PHOXI_CONTROL_PATH)/API/lib/ -lPhoXi_API_msvc12_Debug_1.2.14
这个问题是我们配置qt的问题:
参考:
https://blog.csdn.net/qq_31648921/article/details/94610964
原本是
要改为自己的路径:
2.解决 Qt5 报错 This application failed to start because it could not find or load the Qt platform plugin
参考:
https://www.cnblogs.com/kuangke/p/10862103.html
因为换了一个qt版本,之前的这些用不了,要用现在的,但是你也不知道要用那些,那么直接使用工具
QT为了简化生成发布版本,特别提供了工具 "windeplayqt.exe",这个工具在 "...\Qt5.8.0\5.8\msvc2015_64\bin"的目录下,通过该命令,可以解决上述错误。
windeplayqt.exe D:\code\qt\twocameras_fixed_updated-libs_included\build\debug\sample.exe
windeplayqt.exe D:\code\qt\twocameras_fixed_updated-libs_included\build\release\sample.exe