2016-04-18 138 views
1

我試圖編譯使用msvc2010一個Qt 5.5的應用程序。然而每當我嘗試構建它時,我都會遇到幾個與boost :: iostreams有關的鏈接器錯誤。與升壓QT鏈接錯誤iostreams的

packagehandler.obj:-1: error: LNK2019: unresolved external symbol "public: void __thiscall boost::iostreams::detail::gzip_header::reset(void)" ([email protected][email protected]@[email protected]@@QAEXXZ) referenced in function "public: __thiscall boost::iostreams::detail::gzip_header::gzip_header(void)" ([email protected]@[email protected]@@[email protected]) 
packagehandler.obj:-1: error: LNK2019: unresolved external symbol "public: void __thiscall boost::iostreams::detail::gzip_footer::reset(void)" ([email protected][email protected]@[email protected]@@QAEXXZ) referenced in function "public: __thiscall boost::iostreams::detail::gzip_footer::gzip_footer(void)" ([email protected]@[email protected]@@[email protected]) 
packagehandler.obj:-1: error: LNK2001: unresolved external symbol "int const boost::iostreams::zlib::default_compression" ([email protected]@[email protected]@@3HB) 
packagehandler.obj:-1: error: LNK2001: unresolved external symbol "int const boost::iostreams::zlib::deflated" ([email protected]@[email protected]@@3HB) 
packagehandler.obj:-1: error: LNK2001: unresolved external symbol "int const boost::iostreams::zlib::default_strategy" ([email protected]@[email protected]@@3HB) 
packagehandler.obj:-1: error: LNK2019: unresolved external symbol "protected: __thiscall boost::iostreams::detail::zlib_base::~zlib_base(void)" ([email protected]@[email protected]@@[email protected]) referenced in function [email protected][email protected]@[email protected]@@[email protected]@[email protected]@[email protected][email protected]@@Z$0 
packagehandler.obj:-1: error: LNK2019: unresolved external symbol "protected: __thiscall boost::iostreams::detail::zlib_base::zlib_base(void)" ([email protected]@[email protected]@@[email protected]) referenced in function "public: __thiscall boost::iostreams::detail::zlib_decompressor_impl<class std::allocator<char> >::zlib_decompressor_impl<class std::allocator<char> >(struct boost::iostreams::zlib_params const &)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]@[email protected][email protected]@@Z) 
packagehandler.obj:-1: error: LNK2019: unresolved external symbol "protected: void __thiscall boost::iostreams::detail::zlib_base::reset(bool,bool)" ([email protected][email protected]@[email protected]@@[email protected]) referenced in function "public: __thiscall boost::iostreams::detail::zlib_decompressor_impl<class std::allocator<char> >::~zlib_decompressor_impl<class std::allocator<char> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]@[email protected]) 
packagehandler.obj:-1: error: LNK2019: unresolved external symbol "private: void __thiscall boost::iostreams::detail::zlib_base::do_init(struct boost::iostreams::zlib_params const &,bool,void * (__cdecl*)(void *,unsigned int,unsigned int),void (__cdecl*)(void *,void *),void *)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]@[email protected]) referenced in function "protected: void __thiscall boost::iostreams::detail::zlib_base::init<class std::allocator<char> >(struct boost::iostreams::zlib_params const &,bool,struct boost::iostreams::detail::zlib_allocator<class std::allocator<char>,class std::allocator<char> > &)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]@@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@Z) 
packagehandler.obj:-1: error: LNK2019: unresolved external symbol "public: void __thiscall boost::iostreams::detail::gzip_footer::process(char)" ([email protected][email protected]@[email protected]@@[email protected]) referenced in function [email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]@@[email protected][email protected]@[email protected]@@[email protected]@@[email protected][email protected]@[email protected]@@[email protected]@[email protected]$0 
packagehandler.obj:-1: error: LNK2019: unresolved external symbol "public: void __thiscall boost::iostreams::detail::gzip_header::process(char)" ([email protected][email protected]@[email protected]@@[email protected]) referenced in function "public: __int64 __thiscall boost::iostreams::basic_gzip_decompressor<class std::allocator<char> >::read<class boost::iostreams::detail::linked_streambuf<char,struct std::char_traits<char> > >(class boost::iostreams::detail::linked_streambuf<char,struct std::char_traits<char> > &,char *,__int64)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]@@[email protected][email protected]@[email protected]@@[email protected]@@[email protected][email protected]@[email protected]@@[email protected]@[email protected]) 
packagehandler.obj:-1: error: LNK2001: unresolved external symbol "int const boost::iostreams::zlib::okay" ([email protected]@[email protected]@@3HB) 
packagehandler.obj:-1: error: LNK2001: unresolved external symbol "int const boost::iostreams::zlib::stream_end" ([email protected]@[email protected]@@3HB) 
packagehandler.obj:-1: error: LNK2019: unresolved external symbol "public: static void __cdecl boost::iostreams::zlib_error::check(int)" ([email protected][email protected]@[email protected]@[email protected]) referenced in function "public: bool __thiscall boost::iostreams::detail::zlib_decompressor_impl<class std::allocator<char> >::filter(char const * &,char const *,char * &,char *,bool)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]@[email protected]) 
packagehandler.obj:-1: error: LNK2019: unresolved external symbol "protected: void __thiscall boost::iostreams::detail::zlib_base::after(char const * &,char * &,bool)" ([email protected][email protected]@[email protected]@@[email protected]) referenced in function "public: bool __thiscall boost::iostreams::detail::zlib_decompressor_impl<class std::allocator<char> >::filter(char const * &,char const *,char * &,char *,bool)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]@[email protected]) 
packagehandler.obj:-1: error: LNK2019: unresolved external symbol "protected: int __thiscall boost::iostreams::detail::zlib_base::xinflate(int)" ([email protected][email protected]@[email protected]@@[email protected]) referenced in function "public: bool __thiscall boost::iostreams::detail::zlib_decompressor_impl<class std::allocator<char> >::filter(char const * &,char const *,char * &,char *,bool)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]@[email protected]) 
packagehandler.obj:-1: error: LNK2001: unresolved external symbol "int const boost::iostreams::zlib::sync_flush" ([email protected]@[email protected]@@3HB) 
packagehandler.obj:-1: error: LNK2019: unresolved external symbol "protected: void __thiscall boost::iostreams::detail::zlib_base::before(char const * &,char const *,char * &,char *)" ([email protected][email protected]@[email protected]@@[email protected]) referenced in function "public: bool __thiscall boost::iostreams::detail::zlib_decompressor_impl<class std::allocator<char> >::filter(char const * &,char const *,char * &,char *,bool)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]@[email protected]) 
debug\EmbeddedBoardTestScriptUtility.exe:-1: error: LNK1120: 18 unresolved externals 
+0

TL; DR:使用C++的API,當連接在一起,必須使用Visual Studio的同一主要版本進行編譯,至少是所有C++代碼。 –

+0

@KubaOber也許我的問題是不清楚,我重建提振了msvc2010。我不使用msvc2008的.DLL – CountBale

回答

0

您應該檢查是否libboost_iostreams的.lib庫是在你的Boost庫目錄可用,如果如果在連接連接器項目設置目錄和鏈接庫的正確鏈接。

如果你編譯升壓和對升壓編譯懷疑(它可以排除一些項目的許多選項進行編譯),你可以使用預編譯的二進制可在SourceForge上[1]。

[1] https://sourceforge.net/projects/boost/files/boost-binaries/1.60.0/

+0

這是可用的,我嘗試重命名文件和程序未能在所有的編譯,從來沒有去到鏈接器。 – CountBale

+0

您確定您的PC上只有一個Boost版本?您正在編譯哪種體系結構(32位或64位)?您正在鏈接的Boost版本與您正在編譯的架構相同嗎? –

+0

我安裝了提升(一個編譯msvc2008,一個用於msvc2010)兩個版本,但我已經證實,它正試圖鏈接到正確的。是的,都是32位。我使用boost :: chrono進行了測試,並且鏈接正確,這似乎是該庫特別的問題。 – CountBale