gpt4 book ai didi

c++ - 没有制定目标的规则

转载 作者:太空狗 更新时间:2023-10-29 21:22:59 24 4
gpt4 key购买 nike

我正在尝试使用 C++ 语言制作 QT 应用程序,它将记录来自模拟摄像机的视频。所以我在我的项目中包含了 videoInput.hvideoInput.lib 文件,但是当我尝试运行我的项目时,会发生以下错误。错误是:

mingw32-make[1]: No rule to make target path/to/videoInputd.lib','debug\test.exe' 需要。停止。

请给我解决方案。感谢您的帮助。

感谢您的回复。我已经添加了 LIBS。

我的 .pro 文件是

QT += core gui
QT += widgets
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = test
TEMPLATE = app

SOURCES += main.cpp\
mainwindow.cpp

HEADERS += mainwindow.h \
../../../"Qt Projects/Test projects/test" \
videoInput.h

FORMS += mainwindow.ui

INCLUDEPATH += E:\\ImageProcessing\\opencv_cmake_binaries\\install\\include
LIBS += -LE:\\ImageProcessing\\opencv_cmake_binaries\\install\\lib \
-lopencv_core244.dll \
-lopencv_highgui244.dll \
-lopencv_imgproc244.dll \
-lopencv_features2d244.dll \
-lopencv_calib3d244.dll



win32:CONFIG(release, debug|release): LIBS += -L$$PWD/ -lvideoInput
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/ -lvideoInputd

INCLUDEPATH += $$PWD/../../../"Qt Projects/Test projects/test/videoInput"
DEPENDPATH += $$PWD/../../../"Qt Projects/Test projects/test/videoInput"

win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/videoInput.lib
else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/videoInputd.lib

.pro 文件结尾。然后我将构建模式更改为 Release模式,然后尝试运行然后出现新错误。错误是

error: redefinition of 'bool comInit'

error: 'bool comInit' previously declared here
static bool comInit;

error: redefinition of 'class videoInput'
class videoInput{

error: previous definition of 'class videoInput'
class videoInput{

这四个错误在 videoinput.h 文件中,编译器是这样显示的。我知道文件名是 videoInput.h 但编译输出显示 videoInputd.libdebug\test.exe 需要p>

最佳答案

按照 Sebastian 的指示(将 videoInput.lib 添加到 LIBS)并将构建模式切换为发布,因为您只有发布版本这个库(videoInput.lib,而不是 videoInputd.lib)。

关于c++ - 没有制定目标的规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19374920/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com