Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

error: LNK1181: cannot open input file 'release\main.obj'



  • Hi all,
    I am a newbie to the QT world. I got some QT based project from my vendor. The sample application is built on QT 5.8.0 msvc2013 32 bit/64 bit, But I don't have msvc 2013 but I have msvc 2017 installed on my pc. When building the received code I am getting below issue when rebuilding (after Qmake).

    Can anyone help me out to get rid of this issue?

    error: LNK1181: cannot open input file 'release\main.obj'.
    The kit Desktop Qt 5.8.0 MSVC2017 64bit has configuration issues which might be the root cause for this problem.
    When executing step "Make"

    The Project.Pro file code,

    #-------------------------------------------------
    #
    # Project created by QtCreator 2016-09-21T09:39:10
    #
    #-------------------------------------------------
    
    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    CONFIG += Win64
    #CONFIG += console
    
    Win64 {
        TARGET_NAME = umxPrevViewer64
    } else {
        TARGET_NAME = umxPrevViewer
    }
    
    TEMPLATE = app
    
    
    FORMS    += mainwindow.ui \
                formmain.ui \
                formpreview.ui \
                formenroll.ui \
                formrecog.ui
    
    CONFIG(debug, debug|release) {
    #    DESTDIR = build/debug
        CMI_DEBUG = d
    } else {
    #    DESTDIR = build/release
        CMI_DEBUG =
    }
     
    message("release_build_mode ")
    win32-msvc2017 {
        message("win32-msvc2017 ")
    
        Win64 {
            LIBS += -L"../lib/PocoWin64" \
                -lPocoFoundation$${CMI_DEBUG} \
                -lPocoXML$${CMI_DEBUG} \
                -lPocoUtil$${CMI_DEBUG} \
                -lPocoNet$${CMI_DEBUG} \
                -lPocoJSON$${CMI_DEBUG}
        } else {
           LIBS += -L"../lib/PocoWin" \
                -lPocoFoundation$${CMI_DEBUG} \
                -lPocoXML$${CMI_DEBUG} \
                -lPocoUtil$${CMI_DEBUG} \
                -lPocoNet$${CMI_DEBUG} \
                -lPocoJSON$${CMI_DEBUG}
        }
    
        CONFIG(debug, debug|release) {
     message("win32-msvc2017 32")
            Win64 {
                DESTDIR = "..\\bin\\windows\\debug64\\"
                LIBS += "..\\bin\\windows\\debug64\\umxPrevLib64d.lib"
            } else {
                DESTDIR = "..\\bin\\windows\\debug\\"
                LIBS += "..\\bin\\windows\\debug\\umxPrevLibd.lib"
            }
        } else { message("win32-msvc2017 64")
            Win64 {
                DESTDIR = "..\\bin\\windows\\release64\\"
                LIBS += "..\\bin\\windows\\release64\\umxPrevLib64.lib"
            } else {
                DESTDIR = "..\\bin\\windows\\release\\"
                LIBS += "..\\bin\\windows\\release\\umxPrevLib.lib"
            }
        }
    
        TARGET = $${TARGET_NAME}
    
    
        CMI_HOME = "../include/umxPrevLib"
        POCO_HOME = "../include"
    }  
    
    #INCLUDEPATH += $${POCO_HOME}
    INCLUDEPATH += ../include
    
    SOURCES += main.cpp\
        mainwindow.cpp \
        formmain.cpp \
        formpreview.cpp \
        formenroll.cpp \
        formrecog.cpp \
        restsend.cpp \
        restrecv/handler/LockRequestHandlerM.cpp \
        restrecv/handler/ControlRequestHandlerM.cpp \
        restrecv/restrecvrun.cpp \
        restrecv/restrecv.cpp \
        rs232.c
    
    HEADERS  += mainwindow.h \
        ../include/umxPrevLib/requestdatatype.h \
        ../include/umxPrevLib/umxprevlib.hpp \
        formmain.h \
        global.h \
        formpreview.h \
        formenroll.h \
        formrecog.h \
        restsend.h \
        restrecv/HTTPRequestHandlerFactory.h \
        restrecv/Locker.h \
        restrecv/handler/HTTPRequestVerbHandlerM.h \
        restrecv/handler/LockRequestHandlerM.h \
        restrecv/handler/ControlRequestHandlerM.h \
        restrecv/restrecvrun.h \
        restrecv/restrecv.h \
        rs232.h
    
     
    RESOURCES += \
        images.qrc
    

    The below is my project Build setting.

    0_1527146462666_96af2a6d-bfb5-413d-a054-01ae6c2114d2-image.png

    The below is my Kit setting,

    0_1527146749829_cd74f06d-39a9-4929-a781-0b872a8602cd-image.png


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You should not set DESTDIR as you might be conflicting with the shadow build.

    Something strange here, you seem to be willing to link a library that has the same name as your application. Is that the case ?



  • @SGaist , Thanks for the reply. yes both are same. If possible could you advise me about more in detail?



  • @SGaist ,

    1. In addition to above my comment, The application name is "umxPrevViewer.exe" and lib name is "umxPrevLib.dll",
    2. I am building this with the VS2017 compiler for 64 bit on my Windows 7 64 bit PC.
    3. So Can you advise about the Kit configurations are correct? and As you suggest, Instead of DESTDIR what is the right tag to use there? please advise

  • Lifetime Qt Champion

    Where and when are you building that library ?


Log in to reply