Subj : Re: How to pass class-member function to pthread_create(....)? To : comp.programming.threads From : Jedrzej Dudkiewicz Date : Tue Jul 19 2005 09:51 am > > The C++ standard provides the guarantee that extern "C" gives C linkage. > > The pthreads standard gives the guarantee that pthread_create takes > > functions with C linkage. > > I am sorry, but I would like to see what POSIX says about C linkage in > pthread_create, not your comments on that. Can you make a quote? This http://www.opengroup.org/onlinepubs/007908799/xsh/pthread.h.html says: The following are declared as functions and may also be declared as macros. Function prototypes must be provided for use with an ISO C compiler. So, it's for use with C compiler and this is the way it is used: C header is included and linking with C library is performed. C++ Standard says: 7.5.1 All function types, function names, and variable names have a language linkage. The default language linkage of all function types, function names, and variable names is C++ language linkage. Two function types with different language linkages are distinct types even if they are otherwise identical. (The last sentece was quoted here by Maciej Sobczak) 7.5.2 Linkage between C++ and non-C++ code fragments can be achieved using a linkage-specification: linkage-specification: extern string-literal { delcaration-seq(here goes subscript "opt", but...) } extern string-literal declaration The string-literal indicates the required language linkage. [...] 7.5.3 Every implementation shall provide for linkage to functions written in the C programming language, "C", and linkage to C++ functions, "C++". We use C headers and C libraries in C++ code. The only way to achieve it in C++ is to declare function passed to this libraries as extern "C". JD .