gcc 出错信息


ar rcs libname.a $. o  $.o

  Archive has no index; run ranlib to add one collect2: ld returned 1 exit status


编译时出现 _mcount 未定义

'_mcount' is 用于 gprof. 如果一个目标文件编译时使用了 '-pg' 选项.那么在链接时也得用 '-pg' 选项.


VirtualBox:~/wrk/freetype-2.1.4$ mwl -o ttf2subf main.W -lfreetype

/home/***/wrk/freetype-2.1.4/main.c:69: undefined reference to `_mcount'
/home/***/wrk/freetype-2.1.4/main.c:213: undefined reference to `_mcount'
/home/***/wrk/freetype-2.1.4/main.c:218: undefined reference to `_mcount'
/home/***/wrk/freetype-2.1.4/main.c:223: undefined reference to `_mcount'
/home/***/wrk/freetype-2.1.4/main.c:290: undefined reference to `_mcount'
main.W:/home/***/wrk/freetype-2.1.4/main.c:485: more undefined references to `_mcount' follow


你可能感兴趣的:(gcc 出错信息)