3
부스트 튜토리얼과 라이브러리가 있습니다.Linux에서 boost asio를 컴파일 할 때 링크 오류가 발생했습니다.
나는 부스트위한 기본 튜토리얼을 통해 실행 :
http://www.boost.org/doc/libs/1_52_0/more/getting_started/unix-variants.html
과 괜찮 았는데. 나는 ASIO 튜토리얼에 문제가 오전 :
http://www.boost.org/doc/libs/1_50_0/doc/html/boost_asio/tutorial/tutdaytime1/src.html
그것은 오류를 연결하는 모양을,하지만 난 이전과 동일한 경로를 포함하고있다 :
g++ -I /usr/local/boost_1_52_0 test.cpp -o example
오류 :
/tmp/cce4EZME.o: In function `__static_initialization_and_destruction_0(int, int)':
test.cpp:(.text+0x57b): undefined reference to `boost::system::generic_category()'
test.cpp:(.text+0x587): undefined reference to `boost::system::generic_category()'
test.cpp:(.text+0x593): undefined reference to `boost::system::system_category()'
/tmp/cce4EZME.o: In function `boost::system::error_code::error_code()':
test.cpp:(.text._ZN5boost6system10error_codeC2Ev[_ZN5boost6system10error_codeC5Ev]+0x17): undefined reference to `boost::system::system_category()'
/tmp/cce4EZME.o: In function `boost::asio::error::get_system_category()':
test.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[_ZN5boost4asio5error19get_system_categoryEv]+0x5): undefined reference to `boost::system::system_category()'
/tmp/cce4EZME.o: In function `boost::asio::detail::posix_thread::~posix_thread()':
test.cpp:(.text._ZN5boost4asio6detail12posix_threadD2Ev[_ZN5boost4asio6detail12posix_threadD5Ev]+0x26): undefined reference to `pthread_detach'
/tmp/cce4EZME.o: In function `boost::asio::detail::posix_thread::join()':
test.cpp:(.text._ZN5boost4asio6detail12posix_thread4joinEv[_ZN5boost4asio6detail12posix_thread4joinEv]+0x2b): undefined reference to `pthread_join'
/tmp/cce4EZME.o: In function `boost::asio::detail::posix_thread::start_thread(boost::asio::detail::posix_thread::func_base*)':
test.cpp:(.text._ZN5boost4asio6detail12posix_thread12start_threadEPNS2_9func_baseE[_ZN5boost4asio6detail12posix_thread12start_threadEPNS2_9func_baseE]+0x29): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
당신이 -lboost_system- (뭔가 시스템 별) -lpthread와 필요 어쩌면 -lboost_signals- (뭔가 시스템을 구체적으로) – frankc
당신은 시스템 특정 경우 말할 때 나는 그것을 창문에서 컴파일해야했다. 나는 창문을 동등한 것으로 바꾸어야한다. – Jeff
시스템 라이브러리의 이름이 libboost_system-gcc41-mt.so와 같은 것 같습니다. 심지어 윈도우에서 보이는 게 뭔지도 모르겠다. – frankc