Skip to content
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

undefined reference to `boost::chrono::steady_clock::now()' #9

Closed
daili0015 opened this issue Jul 16, 2017 · 2 comments
Closed

undefined reference to `boost::chrono::steady_clock::now()' #9

daili0015 opened this issue Jul 16, 2017 · 2 comments

Comments

@daili0015
Copy link

daili0015 commented Jul 16, 2017

When i :

cmake .. 
make all

I met:

[ 90%] Built target face_swap_image
[ 95%] Linking CXX executable face_swap_batch
/usr/local/lib/libboost_timer.a(cpu_timer.o): In function `boost::timer::cpu_timer::start()':
cpu_timer.cpp:(.text+0x81d): undefined reference to `boost::chrono::steady_clock::now()'
/usr/local/lib/libboost_timer.a(cpu_timer.o): In function `boost::timer::cpu_timer::stop()':
cpu_timer.cpp:(.text+0x945): undefined reference to `boost::chrono::steady_clock::now()'
/usr/local/lib/libboost_timer.a(cpu_timer.o): In function `boost::timer::cpu_timer::elapsed() const':
cpu_timer.cpp:(.text+0xa49): undefined reference to `boost::chrono::steady_clock::now()'
/usr/local/lib/libboost_timer.a(cpu_timer.o): In function `boost::timer::cpu_timer::resume()':
cpu_timer.cpp:(.text+0xb40): undefined reference to `boost::chrono::steady_clock::now()'
/usr/local/lib/libboost_timer.a(cpu_timer.o): In function `boost::timer::auto_cpu_timer::auto_cpu_timer(std::ostream&, short)':
cpu_timer.cpp:(.text+0xc85): undefined reference to `boost::chrono::steady_clock::now()'
/usr/local/lib/libboost_timer.a(cpu_timer.o):cpu_timer.cpp:(.text+0xd2e): more undefined references to `boost::chrono::steady_clock::now()' follow
collect2: error: ld returned 1 exit status
make[2]: *** [face_swap_batch/face_swap_batch] Error 1
make[1]: *** [face_swap_batch/CMakeFiles/face_swap_batch.dir/all] Error 2
make: *** [all] Error 2

There really no appropriate solutions to this , so i come here again.
This is my dir "/usr/local/lib":
1
There are “libboost_chrono.a” and "libboost_chrono.so" .
So why boost::chrono::steady_clock::now() is undefined? It should be recognized .
8472-1f301100004-51

@YuvalNirkin
Copy link
Owner

YuvalNirkin commented Jul 16, 2017

It is supposed to be linked as a dependency of boost_timer.
Try to force CMake to link it by replacing the following line in the main CMakeLists.txt:

find_package(Boost REQUIRED filesystem program_options regex timer)

with

find_package(Boost REQUIRED filesystem program_options regex timer chrono)

@daili0015
Copy link
Author

That's exactly where the problems is!
Thank you once again.
20161215100553788

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants