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

Create plugin error: LNK1181: cannot open input file 'Cored4.lib'



  • I followed the "http://doc.qt.io/qt-5/plugins-howto.html" to create plugin for QT Creator. I have QT 5.11.2 installed. I have also download the source of QT Creator from git and build it using VS2017 (64bits). The version for QT Creator is 4.7.1.

    Then I started to follow the guide to create my first plugin. I have QT creator source/build pointing to correct directory (D:/workspace/qt-creator and D:/workspace/qtcreator-build)

    But I got the following error when I build my plugins in QT Creator

    11:01:58: Running steps for project myplugin...
    11:01:58: Configuration unchanged, skipping qmake step.
    11:01:58: Starting: "D:\Qt\Qt5.11.2\Tools\QtCreator\bin\jom.exe"
    D:\Qt\Qt5.11.2\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
    link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /INCREMENTAL:NO /DLL /SUBSYSTEM:CONSOLE /VERSION:4.7 /OUT:C:\Users\mleung\AppData\Local\QtProject\qtcreator\plugins\4.7.82\MyPlugind4.dll @C:\Users\mleung\AppData\Local\Temp\MyPlugind4.dll.21152.16.jom
    LINK : fatal error LNK1181: cannot open input file 'Cored4.lib'
    jom: D:\workspace\build-marvintry1-Desktop_Qt_5_11_2_MSVC2017_64bit-Debug\Makefile.Debug [C:\Users\mleung\AppData\Local\QtProject\qtcreator\plugins\4.7.82\MyPlugind4.dll] Error 1181
    jom: D:\workspace\build-marvintry1-Desktop_Qt_5_11_2_MSVC2017_64bit-Debug\Makefile [debug] Error 2
    11:01:58: The process "D:\Qt\Qt5.11.2\Tools\QtCreator\bin\jom.exe" exited with code 2.
    Error while building/deploying project myplugin (kit: Desktop Qt 5.11.2 MSVC2017 64bit)
    When executing step "Make"
    11:01:58: Elapsed time: 00:00.

    Here is my project:
    DEFINES += MARVIN1STPLUGINS_LIBRARY

    marvin1stPlugins files

    SOURCES +=
    marvin1stpluginsplugin.cpp

    HEADERS +=
    marvin1stpluginsplugin.h
    marvin1stplugins_global.h
    marvin1stpluginsconstants.h

    Qt Creator linking

    Either set the IDE_SOURCE_TREE when running qmake,

    or set the QTC_SOURCE environment variable, to override the default setting

    isEmpty(IDE_SOURCE_TREE): IDE_SOURCE_TREE = $$(QTC_SOURCE)
    isEmpty(IDE_SOURCE_TREE): IDE_SOURCE_TREE = "D:/workspace/qt-creator"

    Either set the IDE_BUILD_TREE when running qmake,

    or set the QTC_BUILD environment variable, to override the default setting

    isEmpty(IDE_BUILD_TREE): IDE_BUILD_TREE = $$(QTC_BUILD)
    isEmpty(IDE_BUILD_TREE): IDE_BUILD_TREE = "D:/workspace/qtcreator-build"

    uncomment to build plugin into user config directory

    <localappdata>/plugins/<ideversion>

    where <localappdata> is e.g.

    "%LOCALAPPDATA%\QtProject\qtcreator" on Windows Vista and later

    "$XDG_DATA_HOME/data/QtProject/qtcreator" or "~/.local/share/data/QtProject/qtcreator" on Linux

    "~/Library/Application Support/QtProject/Qt Creator" on OS X

    USE_USER_DESTDIR = yes

    If the plugin can be depended upon by other plugins, this code needs to be outsourced to
    <dirname>_dependencies.pri, where <dirname> is the name of the directory containing the
    plugin's sources.

    QTC_PLUGIN_NAME = marvin1stPlugins
    QTC_LIB_DEPENDS +=
    # nothing here at this time

    QTC_PLUGIN_DEPENDS +=
    coreplugin

    QTC_PLUGIN_RECOMMENDS +=
    # optional plugin dependencies. nothing here at this time

    End _dependencies.pri contents

    include($$IDE_SOURCE_TREE/src/qtcreatorplugin.pri)

    Anyone could help?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Do you have that file somewhere in your hard drive ?


Log in to reply