I've completed the first part of my project, and I want to know how well / bad it performs by profiling it with gprof
. I am working on Android using a Linux emulator named Termux, and I am using g++ as the compiler.
Everything compiles without errors and even warnings, and the binary runs perfectly.
So I decided to put the -pg
flag among the other flags in my makefile, (meaning that both compilation and linking is performed with -pg
) and tried recompiling everything. But something seems to not work properly: during compilation, everything is normal. But when linking I get a argument unused during compilation: '-pg'
warning and then a lot of undefined reference to 'mcount'
(it doesn't even display all of them, after a bit it says more undefined references to 'mcount' follows
) errors, and at the end a linker command failed with exit code 1
error.
What is causing this behaviour? Is something broken / missing on the platform I am using? Can I fix that? How?