Re: [Dev-C++] RES: Problem running .exe
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: piyush g. <pec...@gm...> - 2008-07-04 14:44:57
|
Hi, Thanx Per and Kleber, for your advice. I used the gdb debugger and found out that a segmentation violation was occurring when i tried to reference a pointer used as a 1d array. On allocating memory using malloc for this pointer before referencing it, the problem was removed and the program executed to completion. There is some problem with the result, but i guess that would be due to some logical error in the code. Anyways, thanks again for your suggestions. Regards, Piyush Goswami On Fri, Jul 4, 2008 at 6:17 PM, Per Westermark <pw...@ia...> wrote: > Either run with gdb - I prefer an external debugger to the integration > built into Dev-C++ > > Or write trace output to stderr, and see between which printout your > program dies. > > Just note tha printf() doesn't work, since the output is buffered, so your > program can die with text lines pending in the buffer. > > /pwm > > On Fri, 4 Jul 2008, Kleber Eduardo Clemente wrote: > >> If you don't have any compilation error, the code will compile. >> But, maybe, you have an execution error. Then, in that part the program will close, because it doesn't understand that line. >> >> I think you need use "debbuger" to see where the program is closing. >> >> Regards, >> >> Kleber Eduardo Clemente >> Posto Avançado MRS - Datasul HCM >> Fone: (47) 3802-8848 >> Mail: kle...@da... >> Antes de imprimir este e-mail, pergunte-se: "É realmente necessário?" >> >> -----Mensagem original----- >> De: dev...@li... [mailto:dev...@li...] Em nome de piyush goswami >> Enviada em: sexta-feira, 4 de julho de 2008 07:04 >> Para: dev...@li... >> Assunto: [Dev-C++] Problem running .exe >> >> Hi, >> I have compiled a C source file using the Bloodshed devC++ >> (compilation takes place without any errors but a few warnings). On >> running the code, after incomplete execution, the following message is >> declared: >> '<name>.exe has encountered a problem and needs to close. We are sorry >> for the inconvenience.' >> >> I can't figure out why the code doesn't execute completely. It might >> be relevant that I am using Image Processing routines and thus, large >> arrays (512*512, and 4 of them) are declared in the code. The code >> stops executing before/during the step where i allocate memory using >> 'malloc' for the first 512*512 array (a pointer to a pointer is used a >> 2-d array). >> >> Any help would be greatly appreciated... >> thanx >> >> ------------------------------------------------------------------------- >> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! >> Studies have shown that voting for your favorite open source project, >> along with a healthy diet, reduces your potential for chronic lameness >> and boredom. Vote Now at http://www.sourceforge.net/community/cca08 >> _______________________________________________ >> Dev-cpp-users mailing list >> Dev...@li... >> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >> >> ------------------------------------------------------------------------- >> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! >> Studies have shown that voting for your favorite open source project, >> along with a healthy diet, reduces your potential for chronic lameness >> and boredom. Vote Now at http://www.sourceforge.net/community/cca08 >> _______________________________________________ >> Dev-cpp-users mailing list >> Dev...@li... >> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >> > > |