If you compile and link separately, and you compile with –xpg, be sure to link with –xpg. See 3.3.3 Compile-Time and Link-Time Options for a complete list of options that must be specified at both compile time and link time.
–xprofile=p, the analyzer(1) man page, and the Performance Analyzer manual.