centos7 undefined reference to "folly::detail::Sleeper::kMinYieldingSleep"
- Dominant language
- C++
- Stars
- 30.5k
- Forks
- 5.9k
- PR merge metrics
- No merged PRs in 30d
Description
Env:
CentOS Linux release 7.9 (Final)
tag:
v2021.11.15.00
build:
./build.sh
example test:
#include
#include
#include
class Student {
public:
Student(std::string name, int id, std::string email)
: m_name(name), m_id(id), m_email(email)
{}
void printSelf() const {
std::cout << "name: " << m_name << " "
<< "id: " << m_id << " "
<< "email: " << m_email << std::endl;
}
private:
std::string m_name;
int m_id;
std::string m_email;
};
int main() {
folly::ConcurrentHashMap students;
students.insert("Tom", Student("Tom", 1, "tom@gmail.com"));
students.insert("Lilly", Student("Lilly", 2, "lilly@gmail.com"));
}
compile result:
/tmp/ccGXQnMc.o:‘folly::hazptr_detail::shared_head_only_list, std::atomic>::pop_all_lock()’:
test.c:(.text._ZN5folly13hazptr_detail21shared_head_only_listINS_10hazptr_objISt6atomicEES3_E12pop_all_lockEv[_ZN5folly13hazptr_detail21shared_head_only_listINS_10hazptr_objISt6atomicEES3_E12pop_all_lockEv]+0x149):undefined reference to 'folly::detail::Sleeper::kMinYieldingSleep'
collect2: error: ld returned 1 exit status
Contributor guide
Research direction
Start with ./build.sh and the provided test.c reproducer, which includes folly/concurrency/ConcurrentHashMap.h and fails during linking on CentOS 7.9 with tag v2021.11.15.00. Reproduce the undefined reference and trace the build or link inputs; done means the example links successfully in that environment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100