LNK1181:无法打开输入文件 'D:\programs\gdcm-2.6.2\qt-build\bin.obj'
Posted
技术标签:
【中文标题】LNK1181:无法打开输入文件 \'D:\\programs\\gdcm-2.6.2\\qt-build\\bin.obj\'【英文标题】:LNK1181: cannot open input file 'D:\programs\gdcm-2.6.2\qt-build\bin.obj'LNK1181:无法打开输入文件 'D:\programs\gdcm-2.6.2\qt-build\bin.obj' 【发布时间】:2016-03-07 20:02:15 【问题描述】:我已经使用 cmake 构建了 gdcm 2.6.2 的调试和发布配置,后跟 MS-VS 2013 中的 ALL_BUILD 选项。当我尝试链接在我的 Qt 5.5.1 项目中创建的库时,我收到错误:
LINK : fatal error LNK1181: cannot open input file 'D:\programs\gdcm-2.6.2\qt-build\bin.obj'
控制台日志的详细信息是:
19:47:14: The process "C:\Qt\Qt5.5.1\Tools\QtCreator\bin\jom.exe" exited normally.
19:47:14: Running steps for project dcm_browser...
19:47:14: Configuration unchanged, skipping qmake step.
19:47:14: Starting: "C:\Qt\Qt5.5.1\Tools\QtCreator\bin\jom.exe"
C:\Qt\Qt5.5.1\Tools\QtCreator\bin\jom.exe -f Makefile.Release
link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:release\dcm_browser.exe @C:\Users\drusm\AppData\Local\Temp\dcm_browser.exe.13888.16.jom
LINK : fatal error LNK1181: cannot open input file 'D:\programs\gdcm-2.6.2\qt-build\bin.obj'
jom: D:\programs\code\build-dcm_browser-Desktop_Qt_5_5_1_MSVC2013_64bit-Release\Makefile.Release [release\dcm_browser.exe] Error 1181
jom: D:\programs\code\build-dcm_browser-Desktop_Qt_5_5_1_MSVC2013_64bit-Release\Makefile [release] Error 2
19:47:14: The process "C:\Qt\Qt5.5.1\Tools\QtCreator\bin\jom.exe" exited with code 2.
Error while building/deploying project dcm_browser (kit: Desktop Qt 5.5.1 MSVC2013 64bit)
When executing step "Make"
19:47:14: Elapsed time: 00:08.
我的 .pro 文件是这样的:
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = dcm_browser
TEMPLATE = app
unix:
INCLUDEPATH += /usr/local/include/gdcm-2.6
LIBS += -L/home/usman/programs/gdcm-2.6.3/build/bin
INCLUDEPATH += "D:\programs\gdcm-2.6.2\Source\DataStructureAndEncodingDefinition" \
"D:\programs\gdcm-2.6.2\Source\Common" \
"D:\programs\gdcm-2.6.2\msvc_build\Source\Common" \
D:\programs\gdcm-2.6.2\Source\MediaStorageAndFileFormat \
LIBS+= "D:\programs\gdcm-2.6.2\qt-build\bin"
LIBS += -lgdcmMSFF -lgdcmCommon -lgdcmDICT -lgdcmDSED -lgdcmexpat -lgdcmIOD -lgdcmjpeg8 -lgdcmjpeg12 -lgdcmjpeg16 -lgdcmopenjpeg -lgdcmzlib -lgdcmcharls
SOURCES += main.cpp\
mainwindow.cpp \
dcmdump.cpp \
dcmanonymizer.cpp
HEADERS += mainwindow.h \
dcmdump.h \
dcmanonymizer.h \
FORMS += mainwindow.ui
我一整天都在使用 MS-VS 编译器 2013 (64-bit) 在 Qt creator 和 MS Visual Studio 中构建 gdcm。但没有好处。请帮忙!!!
【问题讨论】:
【参考方案1】:一个小错字,我忘了把 -L 标志放在库路径中:
LIBS+= "D:\programs\gdcm-2.6.2\qt-build\bin"
所以当我修改为
LIBS+= -L"D:\programs\gdcm-2.6.2\qt-build\bin"
编译好了!!!
【讨论】:
以上是关于LNK1181:无法打开输入文件 'D:\programs\gdcm-2.6.2\qt-build\bin.obj'的主要内容,如果未能解决你的问题,请参考以下文章
Qt 5.5.1 MSVC 2013,32 位 - LNK1181:无法打开输入文件 'NIDAQmx.lib'
链接:致命错误 LNK1181:无法打开输入文件“libclamav.lib”
链接:致命错误 LNK1181:无法打开输入文件“zz.exe”
LNK1181:无法打开输入文件 'D:\programs\gdcm-2.6.2\qt-build\bin.obj'