簡體   English   中英

如何將網絡模塊添加到 QT pro 文件中?

[英]How can I add the network module to the QT pro file?

這是 my.pro 文件的外觀:

QT       += core gui
QT       += network
QT       += core
CONFIG   += staticlib
CONFIG   += qml_debug
CONFIG   += qtc_runnable

TEMPLATE = lib

INCLUDEPATH += ...path/Views/


greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++11

DEFINES += QT_DEPRECATED_WARNINGS

SOURCES += \
    main.cpp \
    file.cpp \
    widget.cpp

HEADERS += \
    file.h \
    widget.h

FORMS += \
    widget.ui

qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

我試圖重新運行 qmake,但什么也沒做。 我仍然不斷收到此錯誤:

:-1: error: You need to set an executable in the custom run configuration.

我相信這個錯誤是由於我如何將庫添加到 pro 文件中。

編輯:

07:47:59: Running steps for project project1...
07:47:59: Configuration unchanged, skipping qmake step.
07:47:59: Starting: "C:\Qt\Tools\QtCreator\bin\jom.exe" 
    C:\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
    cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug/project1.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I..\project1 -I. -I..\..\..\..\Qt\5.15.0\msvc2019_64\include -I..\..\..\..\Qt\5.15.0\msvc2019_64\include\QtWidgets -I..\..\..\..\Qt\5.15.0\msvc2019_64\include\QtGui -I..\..\..\..\Qt\5.15.0\msvc2019_64\include\QtANGLE -I..\..\..\..\Qt\5.15.0\msvc2019_64\include\QtNetwork -I..\..\..\..\Qt\5.15.0\msvc2019_64\include\QtCore -Idebug -I. -I/include -I..\..\..\..\Qt\5.15.0\msvc2019_64\mkspecs\win32-msvc -Fodebug\ @C:\Users\user\AppData\Local\Temp\file.obj.10608.16.jom
file.cpp
C:\Users\user\Documents\project1\file.cpp(62) : warning C4700: uninitialized local variable 's' used
C:\Users\user\Documents\project1\file.cpp(93) : warning C4700: uninitialized local variable 's' used
      /OUT:debug\project1.exe @C:\Users\user\AppData\Local\Temp\project1.exe.10608.953.jom
The system cannot find the path specified.
jom: C:\Users\user\Documents\build-project1-Desktop_Qt_5_15_0_MSVC2019_64bit-Debug\Makefile.Debug [debug\project1.exe] Error 1
jom: C:\Users\user\Documents\build-project1-Desktop_Qt_5_15_0_MSVC2019_64bit-Debug\Makefile [debug] Error 2
07:48:00: The process "C:\Qt\Tools\QtCreator\bin\jom.exe" exited with code 2.
Error while building/deploying project project1 (kit: Desktop Qt 5.15.0 MSVC2019 64bit)
When executing step "Make"

我知道未使用的變量警告。 我確實檢查了這些位置,並且能夠找到兩個 cmake 文件。

該錯誤與 pro 文件無關。 這是我的代碼中的語法錯誤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM