gcc: undefined reference to _mcount (gprof instrumentation)

做~自己de王妃 提交于 2019-12-21 03:26:11

问题


When compiling my c++ sources with the -pg option to inject gprof profile instrumentation code the compile fails with the undefined reference to _mcount error.

Without this option everything compiles (and runs) fine. What is wrong in my case? (Solaris 10 SPARC Platform)


回答1:


Are you both compiling each object file and linking the final executable using the '-pg' flag?



来源:https://stackoverflow.com/questions/4603298/gcc-undefined-reference-to-mcount-gprof-instrumentation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!