3

I am trying to make QT application using C++ language which will record the video from analogue camera. so I included the videoInput.h and videoInput.lib files in my project but when i am trying to run the my project then the following error occurs. the error is:

mingw32-make[1]: No rule to make target path/to/videoInputd.lib', needed by 'debug\test.exe'. Stop.

please give me the solution. thanks for help.

Thanks for your reply. I already added LIBS.

My .pro file is

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

end of .pro file. and I changed the build mode to release mode and then try to run then new error comes. The error is

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{

These four errors are in videoinput.h file the compiler shows me like this. And I know the file name is videoInput.h but compile output shows me that videoInputd.lib, needed by debug\test.exe

4

3 回答 3

1

我有类似的问题“没有 tule ro mske tsrgrt。th rrason 是语法错误,例如

testwx:($(OBJS).... 逐行检查你的语法

于 2015-01-26T00:00:36.947 回答
1

按照Sebastian的说法(添加videoInput.libLIBS)并将构建模式切换为发布,因为您只有该库的发布版本(videoInput.lib而不是videoInputd.lib)。

于 2013-10-15T07:41:55.093 回答
1

我得到了解决方案。当我试图在 Qt creator 中包含 videoInput.lib 文件时,当时它显示在上面提到的错误中。所以我使用了 qt-vs-addin,它可以在这里找到。qt-vs-插件

我在 qt-vs-addin 中使用 Visual Studio 2010 为我的应用程序设计了 GUI,并在 Visual Studio 2010 中包含了 videoInput.lib 文件,现在我的应用程序已准备就绪。这将对某人有所帮助。

谢谢大家。

于 2014-01-02T11:30:37.377 回答