GCC

GCC Compiler Errors And How To Fix Them

Date Published:
Last Modified:

undefined reference to `pthread_create’

This error usually occurs when trying to compile C++ code which uses threads on Linux. This error can usually be fixed by adding the option -pthread to the call to g++, e.g.:

$ g++ -pthread main.cpp

Like this page? Upvote with shurikens!

Related Content:

Tags:

comments powered by Disqus