gmon.out isn't created when I compile with -pg flag with g++

妖精的绣舞 提交于 2019-12-04 23:51:50

You have to realize that OS X/MacOS does not provide GNU GCC on the system by default.

Note the output of this command:

ls -la /usr/bin/g++ /usr/bin/clang++

These executables look identical. (Actually! It looks like they are different, but somehow the filesize is identical!)

As far as I can tell, clang doesn't support the production of gprof output. As confusing as it may be, the gcc program will run clang.

I would recommend trying to use homebrew to install GCC on OS X/MacOS. You do want to be careful about how it gets installed, etc., so that you know which command corresponds to which compiler.

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