17

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)

MRalwasser
  • 15,605
  • 15
  • 101
  • 147

1 Answers1

27

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

trojanfoe
  • 120,358
  • 21
  • 212
  • 242