天天看点

gcc编译错误汇集

     1、编译出现错误: undefined reference to `pthread_create',源文件中已经包含"pthread.h",makefile文件也加入了-lpthread见下面

     "...-lc -lpthread  -o rtctest rtctest.o -static

     出现这个原因是-lpthread要发到最后面变成

     "...-lc -lpthread  -o rtctest rtctest.o -static”

      就解决了。

     2、编译出现提示:arm-elf-gcc: -lpthread: linker input file unused since linking not done,原因是编译是还用不到静态库,所以gcc给出提示。

继续阅读