2015-05-23 3 views
0

Я использую 64-разрядный ноутбук Windows 7 Premium для компиляции программ с использованием библиотек Boost.C++ Boost Visual Studio 10 Ошибка компиляции

Я следовал этой ссылке для установки наддува: How to use Boost in Visual Studio 2010

Теперь я получаю эту ошибку, когда я ударил компиляции. Какова причина этого?

У меня есть заголовочный файл

#include <boost/thread.hpp> 

Я использую только нить, семафор и condition_variable для бустера. Я получаю эту ошибку, когда пытаюсь скомпилировать программу.

1> All outputs are up-to-date. 
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::system::error_category const & __cdecl boost::system::system_category(void)" ([email protected]@[email protected]@[email protected]@XZ) referenced in function "public: __thiscall boost::thread_exception::thread_exception(int,char const *)" ([email protected]@@[email protected]@Z) 
1>ThreadedFileWriter.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class boost::system::error_category const & __cdecl boost::system::system_category(void)" ([email protected]@[email protected]@[email protected]@XZ) 
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::system::error_category const & __cdecl boost::system::generic_category(void)" ([email protected]@[email protected]@[email protected]@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'posix_category''(void)" ([email protected]@[email protected]@YAXXZ) 
1>ThreadedFileWriter.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class boost::system::error_category const & __cdecl boost::system::generic_category(void)" ([email protected]@[email protected]@[email protected]@XZ) 
1>ThreadedFileWriter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::thread::~thread(void)" ([email protected]@@[email protected]) referenced in function "public: __thiscall KThreadedFileWriter::KThreadedFileWriter(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" ([email protected]@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) 
1>ThreadedFileWriter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class boost::thread & __thiscall boost::thread::operator=(class boost::thread &&)" ([email protected]@@[email protected][email protected]@Z) referenced in function "public: __thiscall KThreadedFileWriter::KThreadedFileWriter(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" ([email protected]@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) 
1>ThreadedFileWriter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::thread::thread(void)" ([email protected]@@[email protected]) referenced in function "public: __thiscall KThreadedFileWriter::KThreadedFileWriter(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" ([email protected]@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) 
1>ThreadedFileWriter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::detail::win32::handle_manager::handle_manager(void *)" ([email protected]@[email protected]@@[email protected]@Z) referenced in function "public: __thiscall boost::detail::basic_condition_variable::basic_condition_variable(void)" ([email protected]@[email protected]@[email protected]) 
1>ThreadedFileWriter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::detail::win32::handle_manager::~handle_manager(void)" ([email protected]@[email protected]@@[email protected]) referenced in function "public: __thiscall boost::detail::basic_condition_variable::~basic_condition_variable(void)" ([email protected]@[email protected]@[email protected]) 
1>ThreadedFileWriter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class boost::detail::win32::handle_manager & __thiscall boost::detail::win32::handle_manager::operator=(void *)" ([email protected]@[email protected]@@[email protected]@Z) referenced in function "public: void __thiscall boost::detail::basic_condition_variable::notify_all(void)" ([email protected][email protected]@[email protected]@QAEXXZ) 
1>ThreadedFileWriter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::detail::win32::handle_manager::operator void *(void)const " ([email protected]@[email protected]@@QBEPAXXZ) referenced in function "public: void __thiscall boost::detail::basic_cv_list_entry::release(unsigned int)" ([email protected][email protected]@[email protected]@[email protected]) 
1>ThreadedFileWriter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) private: void __thiscall boost::thread::start_thread(void)" ([email protected]@[email protected]@AAEXXZ) referenced in function "public: __thiscall boost::thread::thread<void (__thiscall KThreadedFileWriter::*)(void),class KThreadedFileWriter *>(void (__thiscall KThreadedFileWriter::*)(void),class KThreadedFileWriter *,struct boost::thread::dummy *)" ([email protected]@[email protected]@[email protected]@@[email protected]@@[email protected]@[email protected]@Z) 
1>ThreadedFileWriter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::gregorian::greg_month::greg_month(unsigned short)" ([email protected]@[email protected]@[email protected]@Z) referenced in function "public: __thiscall boost::gregorian::date::date(enum boost::date_time::special_values)" ([email protected]@[email protected]@[email protected][email protected][email protected]@@Z) 
1>ThreadedFileWriter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::gregorian::greg_month::operator unsigned short(void)const " ([email protected]@[email protected]@QBEGXZ) referenced in function "public: static unsigned int __cdecl boost::date_time::gregorian_calendar_base<struct boost::date_time::year_month_day_base<class boost::gregorian::greg_year,class boost::gregorian::greg_month,class boost::gregorian::greg_day>,unsigned int>::day_number(struct boost::date_time::year_month_day_base<class boost::gregorian::greg_year,class boost::gregorian::greg_month,class boost::gregorian::greg_day> const &)" ([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]@@[email protected]@Z) 
1>ThreadedFileWriter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) bool __cdecl boost::this_thread::interruptible_wait(void *,struct boost::detail::timeout)" ([email protected][email protected]@@[email protected]@[email protected]@Z) referenced in function "public: bool __thiscall boost::detail::basic_cv_list_entry::wait(struct boost::detail::timeout)" ([email protected][email protected]@[email protected]@[email protected]@@Z) 
1>ThreadedFileWriter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall boost::detail::win32::handle_manager::operator!(void)const " ([email protected]@[email protected]@@QBE_NXZ) referenced in function "private: class boost::intrusive_ptr<class boost::detail::basic_cv_list_entry> __thiscall boost::detail::basic_condition_variable::get_wait_entry(void)" ([email protected][email protected]@[email protected]@[email protected][email protected]@[email protected]@@[email protected]) 
1>ThreadedFileWriter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void * __thiscall boost::detail::win32::handle_manager::duplicate(void)const " ([email protected][email protected]@[email protected]@@QBEPAXXZ) referenced in function "public: __thiscall boost::detail::basic_cv_list_entry::basic_cv_list_entry(class boost::detail::win32::handle_manager const &)" ([email protected]@[email protected]@[email protected][email protected]@[email protected]@Z) 
1>ThreadedFileWriter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall boost::detail::thread_data_base::~thread_data_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]@@@[email protected]@@[email protected]@@@[email protected]@@[email protected]$$QAV?$bind_[email protected][email protected]@@@[email protected]@@[email protected][email protected]@@@[email protected]@@@[email protected]@@[email protected]@@Z$0 
1>ThreadedFileWriter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::detail::thread_data_base::thread_data_base(void)" ([email protected]@[email protected]@[email protected]) referenced in function "public: __thiscall boost::detail::thread_data<class boost::_bi::bind_t<void,class boost::_mfi::mf0<void,class KThreadedFileWriter>,class boost::_bi::list1<classboost::_bi::value<class KThreadedFileWriter *> > > >::thread_data<class boost::_bi::bind_t<void,class boost::_mfi::mf0<void,class KThreadedFileWriter>,class boost::_bi::list1<class boost::_bi::value<class KThreadedFileWriter *> > > >(class boost::_bi::bind_t<void,class boost::_mfi::mf0<void,class KThreadedFileWriter>,class boost::_bi::list1<class boost::_bi::value<class KThreadedFileWriter *> > > &&)" ([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][email protected]@@@[email protected]@@@[email protected]@@[email protected]@@Z) 
1>ThreadedFileWriter.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall boost::detail::thread_data_base::notify_all_at_thread_exit(class boost::condition_variable *,class boost::mutex *)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@@Z) 
1>E:\WorkspaceSrihare\DynamicMatrix\Problem5\Debug\Problem5.exe : fatal error LNK1120: 18 unresolved externals 
1> 
1>Build FAILED. 

Какая ошибка. Я убедился, что lib и заголовки включены в свойства проекта.

ответ

1

Вам необходимо связать двоичные файлы с вашим проектом, перейти к свойствам вашего проекта, Linker, General и указать адрес в двоичную папку, которую вы скомпилировали в нее (по умолчанию она находится в директории сцены в корне вашего boost папка). Если это не сработало, попробуйте добавить полный адрес в файлы lib, связанные с потоком, в свойствах вашего проекта, Linker, Input, Additional dependencies.