/usr/bin/ld: errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS reference in /tmp/ccKZsHdg.o
/lib/libc.so.6: could not read symbols: Bad value
collect2: ld returned 1 exit status
当时在网上查了好长时间,不少人也遇到这些问题。将
extern int errno;
替换为
#include <errno.h>
便可解决问题,出于线程安全的原因,新的Linux版本将全局变量改成了局部变量。最直观的解决办法就是在程序开头加上
#include <errno.h>,将extern int errno这一句省略。刚开始的时候,一直将<errno.h>看成了<error.h>,用了 一下午时间才发现,无敌郁闷。。。。。。
,还好问题解决了!