今天编译Linux文件,遇到错误
pthread_mutex_timedlock was not declared in this scope
网上查了下:
原文:http://stackoverflow.com/questions/3414834/gcc-stdthread-not-found-in-namespace-std
Works fine on Linux (g++ -std=c++0x -lpthread with no additional defines).
However, this thread on Cygwin mailing list suggests that, at least as of 4.4, _GLIBCXX_HAS_GTHREADS was disabled by an autoconf test when building libstdc++ because pthread implementation of cygwin is missing pthread_mutex_timedlock. Perhaps MinGW has the same problem.
Also, this thread on comp.lang.c++.moderated says the same thing. Not supported by the library.
原来Cygwin中gcc gcc-4.4.3以上就开始不支持 pthread_mutex_timedlock
即使加上参数 -std=c++0x -lpthread (在Linux可以正常)也无用
在使用Cygwin编译Linux文件时遇到pthread_mutex_timedlock未声明的错误。此问题源于Cygwin中gcc4.4.3及以上版本不再支持该函数,即使加入-std=c++0x-lpthread参数也无法解决。
457

被折叠的 条评论
为什么被折叠?



