www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/12/11:04:04

Date: Fri, 12 Feb 1999 11:01:17 -0500
Message-Id: <199902121601.LAA18441@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <000d01be565c$6a6c1240$c510f2d4@jakob> (diness@person.dk)
Subject: Re: C - problems
References: <000d01be565c$6a6c1240$c510f2d4 AT jakob>
Reply-To: djgpp AT delorie DOT com

> I have installed the v2 package og DJGPP, and small trivial programs =
> like "Hello world" works.

Excellent!  That means a lot of things are working.

> Now, I need to run a bigger program, which works on other machines
> (eg code correct, my teacher made it).
>
> C:\dokumenter\matk\nummetoder>gcc -c kap1jh.c

OK, what you need to do is recompile all your sources with "-g", like this:

	gcc -g -c kap1jh.c

When you get your .exe file, run it in the debugger (gdb) like this:

	gdb kap1jh.exe
	(gdb) run
	...
	... crashes
	(gdb) where

The "where" command will tell you where it was when it crashed.  You
can use the "print" or "info locals" commands to try to find out why.

For more information on using gdb (you really should learn to use it
if you're using djgpp to write programs), type "info gdb" at the dos
prompt, or see:

http://www.delorie.com/gnu/docs/gdb/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019