Cygwin中交叉编译pthread_mutex_timedlock问题

今天编译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可以正常)也无用

猜你喜欢

转载自lvdccyb.iteye.com/blog/1487778