我試圖編譯使用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
TL; DR:使用C++的API,當連接在一起,必須使用Visual Studio的同一主要版本進行編譯,至少是所有C++代碼。 –
@KubaOber也許我的問題是不清楚,我重建提振了msvc2010。我不使用msvc2008的.DLL – CountBale