ethereum / aleth

Aleth – Ethereum C++ client, tools and libraries
GNU General Public License v3.0
3.96k stars 2.18k forks source link

cmake: undefined reference to 'pthread_create' #5911

Open jasonclinx opened 3 years ago

jasonclinx commented 3 years ago

Hi is there anyone encountering this error when building aleth? My build process stopped at ERROR and I found undefined reference to 'pthread_create' from CMakeError.log.

How to fix this error?

chfast commented 3 years ago

You must link with pthread, but it depends which target is failing.

MichaelAnthonyP96 commented 3 years ago

If you'd like, I can edit the CMakeLists.txt so that the failure occurs at the configure stage, and warns the builder that they are missing pthread. Otherwise all will proceed normally until the linker attempts to locate something called "pthread_create" and fail at link time.