http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50196
--- Comment #2 from watsonsong <watsonsong at foxmail dot com> 2011-08-27 14:36:44 UTC --- I use macport to install gcc4.6 on my computer, and I add -D_GLIBCXX_HAS_GTHREADS flag to g++ and it report errors: /opt/local/include/gcc46/c++/x86_64-apple-darwin10/bits/c++config.h:159:20: error: 'NULL' was not declared in this scope /opt/local/include/gcc46/c++/x86_64-apple-darwin10/bits/c++config.h:159:38: error: invalid type in declaration bebore ';' token /opt/local/include/gcc46/c++/mutex:276:52: error: there are no arguments to '__gthread_mutex_timedlock' that depend on a template parameter, so a declaration of '__gthread_mutex_timedlock' must be availiable [-fpermissive] /opt/local/include/gcc46/c++/mutex:383:62: error: there are no arguments to '__gthread_recursive_mutex_timedlock' that depend on a template parameter, so a declaration of '__gthread_recursive_mutex_timedlock' must be availiable [-fpermissive] It seems can not just define _GLIBCXX_HAS_GTHREADS.