cygwin & coredump
I'm building the book's code using cygwin and ran across a bug that chewed up a considerable amount of my time. As a newbie, perhaps I'm doing something wrong. On the chance that this is a bug, I hope I can save others from grief.
Chapter 4 is where I discovered the problem. It turns out to be inside the makefile.
The problem is that the Makefile contains the statement 'TMP=tmpnam'. The build fails after the program builds a file $(TMP). Apparently, the local tmpnam.exe file that gets built gets called when make attempts to build the remaining files. (Is there a way to disable the pwd to test this?) I've verified this problem on two out of three machines.
Does anybody know about this bug? Can someone please confirm what I'm experiencing?
Here's a simple test to confirm:
Makefile
--------
TMP=tmpnam
all: $(TMP) program
gcc -c program.c
--------------------------
create two identical files tmpnam.c and program.c with the following code:
--------------------------
#include <stdio.h>
int main()
{
printf("Hello World!");
}
--------------------------
Type make. This is what I get:
C:\Temp\Chap04\>make
gcc tmpnam.c -o tmpnam
gcc program.c -o program
make: *** [program] Aborted (core dumped)
C:\Temp\Chap04\>ls
Makefile gcc.exe.stackdump program.c tmpnam.c tmpnam.exe
------------
Any ideas?
HTH someone else.
|