Solutions to Commonly Encounted Problems

Q: When I try to compile the program, I get millions of syntax errors. What is wrong?

A: You are trying to compile the program with a pre-ANSI C compiler. It cannot understand ANSI function prototypes. Get an ANSI C compiler, such as gcc, and use that.

Q: When I link the program, I get a message ``Undefined symbol _fgetln''. What is wrong?

A: You are running on an older or non-BSD version of Un*x that does not have the ``fgetln()'' function. I actually wrote my own implementation of fgetln() and put it in the code, but it is #ifdef'ed out because I would rather use a library version if it exists. Edit the Makefile and delete the ``-DHAVE_FGETLN'' from the ``CFLAGS'' line. Then re-run ``make''.

Q: When I link the program, I get a message ``Undefined symbol _strdup''. What is wrong?

A: You are running on a version of Un*x that does not have the ``strdup()'' function. There is code for it, but it is #ifdef'ed out because I would rather use a library version if it exists. Edit the Makefile and delete the ``-DHAVE_STRDUP'' from the ``CFLAGS'' line. Then re-run ``make''.

Q: When compiling tags.c, the compiler complains about incompatible types at the line containing ``bsearch()''. What should I do?

A: It may be necessary to place the cast (struct tag *) in front of the call to bsearch() in tags.c, or possibly to change the cast on the function argument to bsearch to make the compiler happy. This is not necessary with gcc, and it is my belief that it should not be necessary under ANSI C.

Q: When compiling main.c, the compiler complains about SEEK_END being undefined. What should I do?

A: Some people have found that they need to #include <unistd.h> in main.c. My belief is that ANSI C dictates that the constant SEEK_END should be in <stdlib.h>. If you are having this problem, try #include'ing <unistd.h> too.

GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu