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

C++ build doesn't include pthread? #112

Open
rohitpaulk opened this issue Dec 30, 2023 · 2 comments
Open

C++ build doesn't include pthread? #112

rohitpaulk opened this issue Dec 30, 2023 · 2 comments
Assignees

Comments

@rohitpaulk
Copy link
Member

For instance every time I try to submit stage 3 for Redis for C++, I keep getting "undefined reference to pthread_create". I have the header files and all of the dependencies installed, so I am just confused why this keeps happening when I try to push to origin master. Is there something completely obvious I am missing?

Thanks for @SamirOsAbdalla for reporting!

@rohitpaulk
Copy link
Member Author

Applying this change to CMakeLists.txt seems to fix the issue:

Screenshot 2023-12-30 at 19 50 23

Let's figure out why this builds locally but not on our build machines - maybe different C++ distributions include different libs by default?

@SamirOsAbdalla
Copy link

The CMakeLists change fixed the issue! As for why the issue arose in the first place, when I try to compile the Server file using g++(without the use of ./spawn_redis_server.sh) I also get the error of undefined reference to pthread_create. I have to add the flag -pthread in order to actually compile the program. Maybe this has something to do with it? This seems to correspond with the fix in the CMakeLists file which also has to link the pthread library.

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

No branches or pull requests

3 participants