Nsight compile time errors


I’m attempting to run a code example; however, the compiler gets stuck at the pthread_create statements: see attachments

MultithreadingExample2.cpp (1.13 KB)
MultithreadingExample2.h (426 Bytes)

You are passing a pointer to a member function. Member function has one additional argument so it cannot be used this way.

StackOverflow has several discussions on the topic, e.g.: http://stackoverflow.com/questions/1151582/pthread-function-from-a-class

I have looked at this article and found it difficult to understand; do you know of a tutorial that explains the subject in clearer detail?


I fiddled around with the property setting on “nsight” and I was able to get to this point: see attachment

How to do I fix the link error?

Simply replace “-lpthread” with “pthread” on the “Libraries” property page.


It works!