[英]error: cannot open file 'boost_atomic-vc120-mt-1_58.lib' boost libs on Qt Windows8
I am trying to build link boost library with Qt creator on windows. 我正在尝试在Windows上使用Qt Creator创建链接增强库。 And I have downloaded boost prebuilt library compiled with msvc-12.0. 而且我已经下载了使用msvc-12.0编译的boost预构建库。
In my .pro file I have added 在我的.pro文件中,我添加了
INCLUDEPATH += C:/local/boost_1_58_0/boost
LIBS += "-LC:/local/boost_1_58_0/stage/lib" -lboost_atomic-vc120-mt-1_58
But while building the project I am getting the error error: LNK1104: cannot open file 'boost_atomic-vc120-mt-1_58.lib'
但是在构建项目时出现错误error: LNK1104: cannot open file 'boost_atomic-vc120-mt-1_58.lib'
My Qt version is Desktop Qt 5.4.1 MSVC2013 64bit
我的Qt版本是Desktop Qt 5.4.1 MSVC2013 64bit
And the compiler list showing 并且编译器列表显示
I have downloaded boost library from http://sourceforge.net/projects/boost/files/boost-binaries/1.58.0/ 我已经从http://sourceforge.net/projects/boost/files/boost-binaries/1.58.0/下载了Boost库
and I choose boost_1_58_0-msvc-12.0-64.exe
as I am using msvc-2013 as my compiler. 我选择了boost_1_58_0-msvc-12.0-64.exe
因为我将msvc-2013用作编译器。
Edit: Compile output 编辑:编译输出
cl : Command line warning D9002 : ignoring unknown option '-lvda'
cl -c -nologo -Zm200 -Zc:wchar_t -FS -lvda -Zi -MDd -GR -W3 -w34100 -w34189 -EHsc /Fddebug\AcessControl-V1.pdb -DUNICODE -DWIN32 -DWIN64 -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_CORE_LIB -I"..\AcessControl-V34-DVR" -I"." -I"..\AcessControl-V24\ffmpeg\include" -I"C:\local\boost_1_58_0\boost" -I"C:\Qt\Qt5.4.1\5.4\msvc2013_64\include" -I"C:\Qt\Qt5.4.1\5.4\msvc2013_64\include\QtQuick" -I"C:\Qt\Qt5.4.1\5.4\msvc2013_64\include\QtWidgets" -I"C:\Qt\Qt5.4.1\5.4\msvc2013_64\include\QtGui" -I"C:\Qt\Qt5.4.1\5.4\msvc2013_64\include\QtANGLE" -I"C:\Qt\Qt5.4.1\5.4\msvc2013_64\include\QtQml" -I"C:\Qt\Qt5.4.1\5.4\msvc2013_64\include\QtNetwork" -I"C:\Qt\Qt5.4.1\5.4\msvc2013_64\include\QtSql" -I"C:\Qt\Qt5.4.1\5.4\msvc2013_64\include\QtCore" -I"debug" -I"C:\Qt\Qt5.4.1\5.4\msvc2013_64\mkspecs\win32-msvc2013" -Fodebug\ @C:\Users\vapplica\AppData\Local\Temp\moc_alert.obj.5536.20297.jom
moc_alert.cpp
cl : Command line warning D9002 : ignoring unknown option '-lvda'
link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:debug\AcessControl-V1.exe @C:\Users\vapplica\AppData\Local\Temp\AcessControl-V1.exe.5536.23406.jom
LINK : fatal error LNK1104: cannot open file 'boost_atomic-vc120-mt-1_58.lib'
jom: E:\Qt_Project\AcessControl-V34\Makefile.Debug [debug\AcessControl-V1.exe] Error 1104
jom: E:\Qt_Project\AcessControl-V34\Makefile [debug] Error 2
16:52:42: The process "C:\Qt\Qt5.4.1\Tools\QtCreator\bin\jom.exe" exited with code 2.
Error while building/deploying project AcessControl-V1 (kit: Desktop Qt 5.4.1 MSVC2013 64bit)
When executing step "Make"
16:52:42: Elapsed time: 00:24.
Does any one know why this error occurs? 有谁知道为什么会发生此错误?
Any help will be appreciated 任何帮助将不胜感激
Thanks Haris 谢谢哈里斯
In your pro file change INCLUDE
and LIBS
directives: 在您的专业文件中,更改INCLUDE
和LIBS
指令:
INCLUDEPATH += C:/local/boost_1_58_0
LIBS += -LC:/local/boost_1_58_0/stage/lib
Make shore that .lib
files in C:/local/boost_1_58_0/stage/lib
directory. 将.lib
文件放在C:/local/boost_1_58_0/stage/lib
目录中。 Also make shore that header files in C:/local/boost_1_58_0/boost
directory. 还应将头文件放在C:/local/boost_1_58_0/boost
目录中。 You need add C:/local/boost_1_58_0
to INCLUDEPATH
for be able to write #include <boost/...>
in your program. 您需要在INCLUDEPATH
添加C:/local/boost_1_58_0
,以便能够在程序中编写#include <boost/...>
。
By default boost use auto-linking. 默认情况下,boost使用自动链接。 You do not need to indicate library name. 您无需指明库名。 If you want disable auto-linking specify BOOST_ALL_NO_LIB
for preprocessor. 如果要禁用自动链接, BOOST_ALL_NO_LIB
为预处理程序指定BOOST_ALL_NO_LIB
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.