[comp.os.msdos.programmer] Turbo C++ overlay problem?

dma+@andrew.cmu.edu (David Andersen) (02/26/91)

I'm having a problem with TURBO C++ 1.0 (actually, 1.01 - we did get the
maintenance release) - I've a VERY simple test program which gives "Null
pointer assignment" on exit.   

The debugger shows "cd 3f" at DS:0000 before (and after) any of my code
executes - 
which looks like an "int 3f" instruction, which looks like TURBO C
overlay initializations are overwritting memory  - which makes me think
I've missed something utterly obvious in the compiler or link
directives, but I don't see it........ 

Enclosed are the makefile, link directives file and *.c files:

------------- makefile

hello.exe: hello.obj hellovl.obj
    tlink @hello.lnk

hello.obj: hello.c
    tcc -c -mm -N -Y hello.c

hellovl.obj: hellovl.c
    tcc -c -mm -N -Yo hellovl.c

-------------- hello.lnk

/v /s /o- c:\tc\lib\c0m.obj+hello.obj+ /o+ hellovl.obj /o-
hello,hello
c:\tc\lib\overlay.lib+
c:\tc\lib\emu.lib+
c:\tc\lib\mathm.lib+
c:\tc\lib\cm.lib

--------------- hello.c

#include <stdio.h>
void main(void) { hellovl(); }

--------------- hellovl.c

#include <stdio.h>
hellovl() {  printf("overlay\n"); }


? ? Anyone see something obvious I've missed ? ?


-- David Andersen
dma@andrew.cmu.edu