c++ - LNK 2019 error using Boost::asio -


i trying test snippet of friends code goes like:

#include <boost/asio.hpp> #include <boost/array.hpp> #include <iostream> #include <sstream> #include <string>  boost::asio::io_service io; std::string port; boost::asio::serial_port_base::baud_rate baud(115200);  int main() {      std::cout << "enter port number: ";      std::getline(std::cin,port);      while(port.empty()) {          std::cout << std::endl;          std::cout << "error: user must provide port number." << std::endl;          std::cout << "enter port number (example: com5): ";          std::getline(std::cin,port);      }      std::cout << std::endl;      return 0; } 

in vc++ directories have linked both include , 64 bit libraries.

in linker -> input have put additional dependencies.

whenever run code error:

error 1 error lnk2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@yaabverror_category@12@xz) referenced in function "public: __thiscall boost::system::error_code::error_code(void)" (??0error_code@system@boost@@qae@xz) c:\users\bilal\documents\visual studio 2012\projects\serial\serial\main.obj serial

and

error 2 error lnk2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@yaabverror_category@12@xz) referenced in function "void __cdecl boost::system::`dynamic initializer 'errno_ecat''(void)" (??__eerrno_ecat@system@boost@@yaxxz) c:\users\bilal\documents\visual studio 2012\projects\serial\serial\main.obj serial

can tell me what's going wrong?

you need specify path of lib(linker->additional library directories, input boost lib is), or add library system library path(in linux)/sys path(in windows).


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -