Menu

a gmon file ?

2008-01-28
2012-09-26
  • Nobody/Anonymous

    hi there
    i am a newbie whit c and i did learn a bit c++ first and then some pascal before i was ready to start
    learning c
    my question is simple
    using dev cpp on windows me
    i am starting to get a file named gmon.out everytime i run a small c program.
    what is this ?
    it have nerver happen before whit c++ or pascal and it was
    not one of the first things in my c example programs i noticed.

    please bear over whit me for not knowing enough about all these things yet.
    but i do know there is on linux a a.out file that you have to run as en executeable file when
    you have compiled the program and wanna run it.
    there is something in windows or dos called an a.out file that i do not know exactly what is
    and this gmon.out file comes right next to the example programs i run besides the exe when the example program stops running.
    this subjekt is not covered in any of the c tutorials or the book i am learning from
    please help me get some understanding of this.
    i should say also that i recently had a small vira in this system so
    i wood be gratefull to get to know if this is a problem whit c dev cpp
    my newbie skills or if it is a visibel sign of something vira like still left ?
    sorry for not posting any codes or compillerlogs but somehow i dont think that you could get anything out of these .
    by the way it does not happen on the ohter computer i have whit an dualboot between xp and linux.
    of course the a.out on linux comes as i expect it to according to the teachings i got so far.

    thank you for reading this this much.

     
    • Nobody/Anonymous

      yes it is fixed
      no more gmon outs
      thank you.

      i found a few pages on the net regarding the gmon files on danish so i have a better idea what they are and what they do.
      any way thanks for the help

       
    • Nobody/Anonymous

      gmon.out is a file used for code profiling, it's output is turned on with a compile
      option to turn on profiling -pg

       
      • Nobody/Anonymous

        Next time, instead of skipping the information that you don't think we
        need, just post what you are asked to. You don't know what we need and
        don't need.

        In this case, the compile log tells us what options you have set which is
        very important for your question.

         
    • Nobody/Anonymous

      thanks
      i was not sure when the problem first accured and i was pretty focused on the tutorials rather than the compiler settings .i will look in the compilermanuals for further help on this subjekt .
      thanks for the help

       
    • cpns

      cpns - 2008-01-28

      If you don't know what your problem is, how are you qualified to determine what is important diagnostic information or not!?

      You were lucky that the previous respondant knew about gmon.out, but many more here would have noticed the unusal appearence of -pg option in the compile log - that is why you should post it. It shows not only build error messages but also exactly how the tools were invoked. So not having any errors does not mean that the log is not useful.

      Now having said all that, merely typing "gmon.out" into Google would have answered your question. I wonder why you would not have tried that first?

      You have to explicitly switch on the profile data generation through the options dialog. If you don't know what something does, it probably pays not to fiddle with it!

      Clifford

       
    • Nobody/Anonymous

      ok i see what you mean

      Kompiler: Default compiler

      Eksekverer gcc.exe...

      gcc.exe "C:\codeprojekts\example14.c" -o "C:\codeprojekts\example14.exe" -pg -g3 -I"C:\DEVCPPFULLPACK\include" -L"C:\DEVCPPFULLPACK\lib" -L"C:\devcppfullpack\include\tv" -L"C:\devcppfullpack\include\tv\win32" -lgmon -pg -g3

      Eksekvering afbrudt

      Kompilering gennemført

      danish language settings in devc++ 4.9.9.2

      operative system windows me 4.90.3000

      genuineintel celeron
      cpu

      the newbie program i created to see the if statement

      before reading next page in the book.

      i have used inno setup to create my own dev c++ set up whit the devpacks i downloaded.
      burned it on a cd named it devcppfullpack and that way i do not have to download any more devpacks if i get a virus or deletes by any accident windows and i can use this cd to install on my ohter machine as well whitout downloading anymore.

      its only a coupel of days since i started learning c so its just an simpel littel aha program i tested
      i have then tried some ohter examples from the book and then i saw the gmon file . i think this must be the program where it start from or rather i think i deleted all the very first programs .

      include<stdio.h>

      int cowcount(int cows,int chickens)

      {

      printf("you have %d cows\n",cows);

      printf("you have %d chickens\n",chickens);

      getchar();

      }

      int max_cows_chickens(int cows,int chickens)

      {

      if (cows>100)

      {

      printf("max cowlimit is 100 \n");

      printf("you have %d cows\n",cows);

      printf("please sell some cows\n");

      getchar();

      }

      if (chickens > 125)

      {

      printf("max chickenlimit is 125\n");

      printf("you have %d chickens \n",chickens);

      printf("please eat some of your chickens\n");

      getchar();

      }

      }

      int main()

      {

      int x,y;
      
      x=0;
      
      y=0;
      

      printf("this program will help administer your cows\n");

      printf("and chickens :) \n");

      printf("enter number of cows you have\n");

      scanf("%d",&x);

      printf("please enter how many chickens you have\n");

      scanf("%d",&y);

      cowcount(x,y);

      max_cows_chickens(x,y);

      printf("press any key to exit\n");

      system("pause");

      return 0;

      }

       
    • cpns

      cpns - 2008-01-29

      It is good that you posted the requested information, but it us somewhat irellevant now since your question was answered. Have you switched off the profiling yet? That is the solution.

      If your were not "focused" on the compiler settings how did they get set I wonder? - Profiling has to be switched on, it is not the default.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.