Closed jnarayan81 closed 6 years ago
Scanning dependencies of target KMatch [ 49%] Building CXX object CMakeFiles/KMatch.dir/kmatch/KMatch.cc.o [ 50%] Linking CXX executable bin/KMatch CMakeFiles/KMatch.dir/kmatch/KMatch.cc.o: In function std::thread::thread<void (KMatch::*)(), std::reference_wrapper<KMatch> >(void (KMatch::*&&)(), std::reference_wrapper<KMatch>&&)': KMatch.cc:(.text._ZNSt6threadC2IM6KMatchFvvEJSt17reference_wrapperIS1_EEEEOT_DpOT0_[_ZNSt6threadC5IM6KMatchFvvEJSt17reference_wrapperIS1_EEEEOT_DpOT0_]+0x69): undefined reference topthread_create' collect2: error: ld returned 1 exit status CMakeFiles/KMatch.dir/build.make:94: recipe for target 'bin/KMatch' failed make[2]: [bin/KMatch] Error 1 CMakeFiles/Makefile2:474: recipe for target 'CMakeFiles/KMatch.dir/all' failed make[1]: [CMakeFiles/KMatch.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2
std::thread::thread<void (KMatch::*)(), std::reference_wrapper<KMatch> >(void (KMatch::*&&)(), std::reference_wrapper<KMatch>&&)': KMatch.cc:(.text._ZNSt6threadC2IM6KMatchFvvEJSt17reference_wrapperIS1_EEEEOT_DpOT0_[_ZNSt6threadC5IM6KMatchFvvEJSt17reference_wrapperIS1_EEEEOT_DpOT0_]+0x69): undefined reference to
You need to link pthread to the executable. See my earlier issue #2 and edit CMakeLists.txt on how to fix that issue.
pthread
CMakeLists.txt
Thanks for your favor. It got resolved by editing CMakeLists.txt file.
Scanning dependencies of target KMatch [ 49%] Building CXX object CMakeFiles/KMatch.dir/kmatch/KMatch.cc.o [ 50%] Linking CXX executable bin/KMatch CMakeFiles/KMatch.dir/kmatch/KMatch.cc.o: In function
std::thread::thread<void (KMatch::*)(), std::reference_wrapper<KMatch> >(void (KMatch::*&&)(), std::reference_wrapper<KMatch>&&)': KMatch.cc:(.text._ZNSt6threadC2IM6KMatchFvvEJSt17reference_wrapperIS1_EEEEOT_DpOT0_[_ZNSt6threadC5IM6KMatchFvvEJSt17reference_wrapperIS1_EEEEOT_DpOT0_]+0x69): undefined reference to
pthread_create' collect2: error: ld returned 1 exit status CMakeFiles/KMatch.dir/build.make:94: recipe for target 'bin/KMatch' failed make[2]: [bin/KMatch] Error 1 CMakeFiles/Makefile2:474: recipe for target 'CMakeFiles/KMatch.dir/all' failed make[1]: [CMakeFiles/KMatch.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2