-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libgrasp_candidates_generator.so:对‘boost::this_thread::hidden::sleep_until(timespec const&)’未定义的引用 #14
Comments
I had a similar problem and was able to resolve it by adding the following include directive to #include <boost/thread/thread.hpp> After this I still had some linking errors for Boost libraries:
I resolved these errors by adding the following lines to my CMakeLists.txt:
I do not know if this is the correct solution to this problem nor have I tested the library yet but it allowed me to finish the build without errors. I am on Ubuntu 20.04 with Boost 1.71. |
I am very glad to receive your reply, I have solved this mistake, my Ubuntu version is 18.04, I changed the Boost version to 1.53 is correct.This error was encountered earlier because the Boost version was too high.
…------------------ 原始邮件 ------------------
发件人: "atenpas/gpg" ***@***.***>;
发送时间: 2022年3月22日(星期二) 上午6:17
***@***.***>;
***@***.******@***.***>;
主题: Re: [atenpas/gpg] libgrasp_candidates_generator.so:对‘boost::this_thread::hidden::sleep_until(timespec const&)’未定义的引用 (Issue #14)
I was able to solve this problem by adding the following include directive to src/gpg/plot.cpp:
#include <boost/thread/thread.hpp>
After this I still had some linking errors for Boost libraries:
/usr/bin/ld: libgrasp_candidates_generator.so: undefined reference to `boost::this_thread::interruption_point()' /usr/bin/ld: libgrasp_candidates_generator.so: undefined reference to `boost::detail::get_current_thread_data()'
I resolved these errors by adding the following lines to my CMakeLists.txt:
# Boost find_package(Boost REQUIRED COMPONENTS thread) include_directories(${Boost_INCLUDE_DIR}) link_directories(${Boost_LIBRARY_DIRS}) add_definitions(-DBOOST_ALL_DYN_LINK) # after add_executable() with the other target_link_libraries() target_link_libraries(${PROJECT_NAME}_grasp_candidates_generator ${Boost_LIBRARIES})
I do not know if this is the correct solution to this problem nor have I tested the library yet but it allowed me to finish the build without errors. I am on Ubuntu 20.04 with Boost 1.71.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
ye u r right thanks bro!!!
|
Hello, I encountered an error when using your library,libgrasp_candidates_generator.so:对‘boost::this_thread::hidden::sleep_until(timespec const&)’未定义的引用,My boost library version is 1.65.1,Can you give me some help?
The text was updated successfully, but these errors were encountered: