Open Jayku88 opened 1 year ago
I added following in main.cpp
Now the error changed as follows
in function void boost::this_thread::sleep<boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000000l> >(boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000000l> const&)': main.cpp:(.text._ZN5boost11this_thread5sleepINS_9date_time18subsecond_durationINS_10posix_time13time_durationELl1000000EEEEEvRKT_[_ZN5boost11this_thread5sleepINS_9date_time18subsecond_durationINS_10posix_time13time_durationELl1000000EEEEEvRKT_]+0x231): undefined reference to
boost::detail::get_current_thread_data()'
Compiling on Linux, I get the same error. Using standard library did the trick for me - only thing to change is line 142 in main.cpp to
std::this_thread::sleep_for(std::chrono::milliseconds(100000));
No further includes needed.
Scanning dependencies of target GrorReg [ 33%] Building CXX object CMakeFiles/GrorReg.dir/src/gror_pre.cpp.o [ 66%] Building CXX object CMakeFiles/GrorReg.dir/src/main.cpp.o /home/ao15230/Desktop/jk/GROR-main/src/main.cpp: In lambda function: /home/ao15230/Desktop/jk/GROR-main/src/main.cpp:142:11: error: ‘boost::this_thread’ has not been declared 142 | boost::this_thread::sleep(boost::posix_time::microseconds(100000)); | ^
~~make[3]: [CMakeFiles/GrorReg.dir/build.make:76: CMakeFiles/GrorReg.dir/src/main.cpp.o] Error 1 make[2]: [CMakeFiles/Makefile2:76: CMakeFiles/GrorReg.dir/all] Error 2 make[1]: [CMakeFiles/Makefile2:83: CMakeFiles/GrorReg.dir/rule] Error 2 make: [Makefile:118: GrorReg] Error 2