I am just trying to run a simple program right now to get profiling to
work before I move on to my larger program. Currenlty the code is very
simple:

#include <iostream>

int main (int argc, char*argv[])
{
   int b = 0;
   for(int i = 0; i < 10000000; i++)
   {
      b++;
   }
 std::cout << b;
}

As you can see it is very basic and I named the file main.cpp. When I
compile I get a warning when I  run the line:

> g++ -g -pg main.cpp
I get the warning:
consider linking with '-static' as system libraries with profiling
support are only provided in archive format

I get an a.out file, but when running the a.out I don't get a
gmon.out. I tried running with the -static in the command line:

>g++ -g -pg -static main.cpp
I don't get the warning and when I run a.out I get the gmon.out file,
but my larger program can't be run with the static flag. Is there a
way around this??
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to