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'
我在 MS-VS 2013 中使用 cmake 后跟 ALL_BUILD 选项构建了 gdcm 2.6.2 的调试和发布配置。当我尝试 link 在我的 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 位)在 Qt creator 和 MS visual studio 中构建 gdcm。但不好。请帮助!!!
一个小错别字,我忘了把 -L 标志放在库路径中:
LIBS+= "D:\programs\gdcm-2.6.2\qt-build\bin"
所以当我修改为
LIBS+= -L"D:\programs\gdcm-2.6.2\qt-build\bin"
编译成功!!!
我在 MS-VS 2013 中使用 cmake 后跟 ALL_BUILD 选项构建了 gdcm 2.6.2 的调试和发布配置。当我尝试 link 在我的 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 位)在 Qt creator 和 MS visual studio 中构建 gdcm。但不好。请帮助!!!
一个小错别字,我忘了把 -L 标志放在库路径中:
LIBS+= "D:\programs\gdcm-2.6.2\qt-build\bin"
所以当我修改为
LIBS+= -L"D:\programs\gdcm-2.6.2\qt-build\bin"
编译成功!!!