Every time I try to link separate object modules together I get this error. However, when I put all the source code in one asm file, compile & link it it works fine. I am using TASM 5.0 in Windows 95 using tasm32 & tlink32. This is how I have my startup file skeleton test95.ASM:
.386
locals
jumps
.MODEL flat,STDCALL
include
.DATA
extrn
.CODE
extrn
start:
ends
end start
Here is the skeleton for the other modules:
.386
locals
jumps
.MODEL flat,STDCALL
include
.DATA
extrn
.CODE
extrn
ends
end
Could someone PLEASE tell me what I am doing wrong. Please e-mail & post a reply.
Thanks in advance,
Charlie
Well after much wasted time I finally found the problem. tlink32 will crash if the 1st byte of the .data segment is uninitilized in the 1st module ONLY with multiple modules. For example if you define the 1st modules .data segment as..
.data
whoops db ? ;this will cause tlink32 to crash
hWndMain dd 0
.
.
.
Is this a bug with tlink32? It sure sounds like it. The only thing Borland had about this error message "General error in module.." was that it was caused by abnormalities in source files (16 bit segments etc..). Is having the 1st data entry unitialized an abnormality?
Try this for yourself and let me know your opinions on this. Are there any more quirks I should watch out for?
Thanks,
Charlie
Yes Charlie there are a lots of Quirks.... :)
But i have to agree ... it never crossed my mind to ever use noninitialized data in a .data section...its place is in .data? sectio ...is it not?
At least if its in initialized data section use a
.data
whoops db 0 ; i think "?" instead of "0" is WRONG here
.code
what are u going to lose?
i hope you dont need the "?" in your program :)