Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No rule to make target

Tags:

c++

qt

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

like image 321
user2865434 Avatar asked Jan 30 '26 01:01

user2865434


2 Answers

Do as Sebastian tells (add videoInput.lib to LIBS) and switch build mode to release, since you have only release version of this library (videoInput.lib, not videoInputd.lib).

like image 191
Fenix Voltres Avatar answered Feb 01 '26 16:02

Fenix Voltres


I got the solution. When I was trying to include videoInput.lib file in Qt creator, at that time it was displayed above mention error. So I used qt-vs-addin which is available here. qt-vs-addin.

I designed GUI in qt-vs-addin using visual studio 2010 for my application and include videoInput.lib file in visual studio 2010 and now my application is ready. This will be helpful for someone.

Thanks to all.

like image 25
user2865434 Avatar answered Feb 01 '26 16:02

user2865434



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!