Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiling and Executing Question - Newbie

Status
Not open for further replies.

psandekian

Programmer
Oct 12, 2000
48
0
0
US
Hi from a Newbie.

I'm using C on a UNIX-like system called REGULUS(it's antique but I have to use it do the complex application that I'm trying to update). I'm trying to use #ifdef to write some variable constants to my console window so I can see where my error is occurring but every time I run it, it locks up my system tight. Here's what I'm doing:
Code:
PUBLIC long *todptr;   /* pointer to long system time */
...
#define DEBUG 
...
main ()
...
#ifdef DEBUG
   FILE *fp = fopen ("/dev/console","w");
#endif
...
   todptr = asystime();
#ifdef DEBUG
   fprintf (fp, "todptr = %d", todptr);
   fflush (fp);
#endif
...

I'm compiling using:
cc $CFL7000 -Y -c psmain.c
make exec

$CFL7000 flag is a really long list of compiling options.

I hope someone can see my error and point me in the right direction.

Just curious, is there any way to step through the code?
Thanks!
Patty
 
I Dont' know whats' wrong with that, but you could simply use printf function to write at the standard output...

You can step through code using -ggdb compiler option (see man), and start with /gdb ./yourprogram... and use step (type help for more info in gdb console).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top