Window-安裝qt-MVSC2013編譯器--遇到問題-找不到opencv庫

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章