Skip to content
Advertisement

VS2017 Linux C++ threads issue

I have been testing the VS2017 Linux C++ with remote debugger on Linux Ubuntu. I have created a few example projects for C++ and everything has been working great until I got to threading examples.

I cannot seem to get the threads to compile as I keep getting “undefined reference to `pthread_create'” error. I know the solution to this is to add -lpthread or -pthread to the VS project properties command line but this does not seem to work in this case.

If anyone has got this working could you please point me in the right direction.

Advertisement

Answer

linker->input->library dependencies pthread

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement