help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: G++ -pg no gmon.out


From: abba
Subject: Re: G++ -pg no gmon.out
Date: Tue, 28 Apr 2009 11:59:11 -0700 (PDT)
User-agent: G2/1.0

On Apr 16, 7:41 am, abba <chad.stev...@gmail.com> wrote:
> On Apr 16, 7:10 am, abba <chad.stev...@gmail.com> wrote:
>
>
>
> > 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??
>
> I made a mistake...it wont link that static...I had to change it to
> stdio.h and use a printf instead of iostream. After changing that I
> changed it to static and it worked.

So I have been able to find that the issue is that our HP-UX machine
doesn't have the gcrt1.o file it only has the gcrt0.o file and that
has some issues with shared libraries. Does anyone know where I could
get this (what library it is installed with) for an HP-UX 11 machine??


reply via email to

[Prev in Thread] Current Thread [Next in Thread]