gcc:未定义对_mcount的引用(gprof instrumentation) [英] gcc: undefined reference to _mcount (gprof instrumentation)

查看:1384
本文介绍了gcc:未定义对_mcount的引用(gprof instrumentation)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 -pg 选项编译我的c ++源代码以注入gprof profile instrumentation代码时,编译失败,未定义的_mcount引用错误。

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.

没有这个选项,一切都编译(和运行)。
我的case是什么错? (Solaris 10 SPARC平台)

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

推荐答案

两者编译每个对象文件并链接最终可执行文件使用-pg标志?

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

这篇关于gcc:未定义对_mcount的引用(gprof instrumentation)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆