Screwy compile in Turbo C
Bob Calbridge
bobc at killer.DALLAS.TX.US
Thu Mar 2 10:48:19 AEST 1989
I posted this question to comp.sys.ibm.pc 'cause I wasn't sure if this
was the proper forum for posting questions on quirky C compilers. But since
there was no helpful response on that group and Borland was insistant that
I don't know how to spell "main" I need to turn to this group in case there
is anyone who ran into this problem using Turbo C.
Here's the situation. I wrote a program to generate a script file for
Kermit. I got the program to compile and run and it did a fine job. However,
I added a piece of code to print instructions at the end of the program.
Nothing fancy, just a for loop reading an array of char * and outputting
them to the file. Suddenly, my compile returned the linker error message
Undefined function '_main' in module C0T.OBJ
Many people told me that I must have either left out or mispelled "main".
I deleted many lines around that line and re-entered them on the chance that
some hidden character had crept into the file. I even retyped a considerable
amount of code at the beginning of the file just to see if there was some
error in the entry.
Oddly enough this morning, while doing what I could to get it to compile, I
accidently hit the F9 hot-key. To my surprise the error message disappeared and
another error turned up in that an apostrophe had been duplicated. I fixed that
part, recompiled and "Voila" no linker error. Feeling cocky, I went back to
my header file and added a few pointers to blank lines to the file and "Boom"
bad compile.
This project is due all too soon and I need some advice.
Thanks in advance.
Bob
More information about the Comp.lang.c
mailing list