User forums > Help

How to profile?

<< < (2/2)

z0b:
OK, created new project (not exactly "Hello World" but new project from the Win32GUI template) and it did create profiling output. So the problem is somewhere else. Something in my project prevents the profiling output generation.

Does anyone have any idea what would cause that? Perhaps one of those libraries I'm using?

mandrav:

--- Quote ----lstdc++ -lgcc
--- End quote ---

Are these options necessary in your linker options?

Also make sure of the following:

--- Quote ---Your program exited abnormally. The function which generates gmon.out is registered with the atexit library function, and won't be called if the program was terminated in an abnormal way. Make sure that your program exits with a call to exit library function or with a return statement in your main function. For example, if your program dies with an exception or a signal, you need to install a handler for that signal and make it call exit.
--- End quote ---


Yiannis.

z0b:

--- Quote ---
Your program exited abnormally. The function which generates gmon.out is registered with the atexit library function, and won't be called if the program was terminated in an abnormal way. Make sure that your program exits with a call to exit library function or with a return statement in your main function. For example, if your program dies with an exception or a signal, you need to install a handler for that signal and make it call exit.

--- End quote ---


That's it! You see, I have one function called exitEditor() that I call when user clicks the X, chooses File/Exit, etc. The last line in that function was "exit(1);", I changed it to "exit(0);" and behold, gmon.out appeared to same directory with the EXE and gprof is happy.

So that was it. Thanks mandrav! :D

mandrav:
I 'm glad we got it working :)

Yiannis.

Navigation

[0] Message Index

[*] Previous page

Go to full version