如果没有链接pthread库,即使代码本身没有问题,程序在运行时也会因为找不到pthread_cancel函数的实现而出错。 检查代码是否有语法错误导致'pthread_cancel'无法识别: 如果以上两步都正确无误,但仍然出现“use of undeclared identifier 'pthread_cancel'”的错误,那么可能是代码中存在语法错误,导致编译器无法正确解析包含...
crypto/thread/arch/thread_posix.c:25:28: error: use of undeclared identifier 'PTHREAD_CANCEL_ENABLE' pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); ^ crypto/thread/arch/thread_posix.c:26:5: warning: implicit declaration of function...