Anyone have suggestions regarding the form for assembley code files used
with Borland's version C compiler? The code below, assembled by masm6, doesn't
satisfy the linker (Borland's).
The segment names are a guess for the most part - taken from masm6's
accrued examples on other projects. "cs:DGROUP" appears off but, if the error
is due to segment names, maybe someone here knows suitable names?
The code & bat file & error messages are included below.
Hul
*********************************************************
; wedtst.asm
name SUPP32 ; ???
.386p
public _wedtst
; Segments & groups
DGROUP group _TEXT
_TEXT segment
assume cs:DGROUP,ds:DGROUP
_wedtst proc ; awk (WORD gdtsize, DWORD flataddr) void public
push bp ;save bp
mov bp,sp ; -> stack frame
mov eax, 66
pop bp ;restore bp
ret
_wedtst endp
_TEXT ends
end
******** bat file
SET BC55PATH=C:\BOR5
%BC55PATH%\bin\bcc32 -c -tW -a4 -g20 -I.. -I%BC55PATH%\include windil.c >
compout.txt
rem %BC55PATH%\bin\brc32 -i%BC55PATH%\include windil.rc >> compout.txt
%BC55PATH%\bin\ilink32 -L%BC55PATH%\lib -c -aa -Tpe c0w32+windil+wedtst,windil,
NULL,import32.lib+cw32.lib,, >> compout.txt
type compout.txt | more
******* compout.txt
C:\bor5\wed>SET BC55PATH=C:\BOR5
C:\bor5\wed>C:\BOR5\bin\bcc32 -c -tW -a4 -g20 -I.. -IC:\BOR5\include windil.c
1>compout.txt
C:\bor5\wed>C:\BOR5\bin\ilink32 -LC:\BOR5\lib -c -aa -Tpe c0w32+windil+wedtst,
windil,NULL,import32.lib+cw32.lib,, 1>>compout.txt
C:\bor5\wed>type compout.txt | more
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
WINDIL.C:
Warning W8057 WINDIL.C 48: Parameter 'hPrevinstance' is never used in function
WinMain
Warning W8057 WINDIL.C 48: Parameter 'szCmdLine' is never used in function
WinMain
Warning W8065 WINDIL.C 200: Call to function 'pooi' with no prototype in
function WndProc
Warning W8065 WINDIL.C 262: Call to function 'iitoaa' with no prototype in
function pooi
Warning W8070 WINDIL.C 265: Function should return a value in function pooi
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_wedtst' referenced from C:\BOR5\WED\WINDIL.OBJ
;asm
NOSMART
.386
LARGESTACK
.text SEGMENT PUBLIC USE32
ASSUME cs:.text, ds:NOTHING, es:NOTHING
PUBLIC _TestFunction
; Prototype: extern "C" int TestFunction(int x1, int x2);
_TestFunction proc
...
ret
_TestFunction endp
.text ENDS
END
Regards,
Friedel
Hul
ps - thanks once again for the examples of required syntax for borland's
compiler & ms' win32.
More working with Borland's compiler: trying to link 2 .obj files generated
by Borland's compiler without any errors indicated, untill the .exe is
executed. Then windows pops a window saying, roughly, this application has
generated an error and we are closing the application - an error log is being
created.
Anyone know where Microsoft hides their error logs?
Hul
hth, Friedel
> Friedel - the format of the code you sent may make a difference - one way
> to see. Along these same lines, do you have a copy of the syntax used with
> the linker? The cause may lay there rather than within the code itself.
As I used the resulting obj file with BC 5.02 IDE, I haven't.
It is some time ago, that I worked with BC55; IMO your linker call is ok.
I assume, you assembled the obj file with tasm?
If you use masm, you get a COFF type obj, but BCC needs OMF. Use coff2omf
then to convert it, if you do not have tasm.
> ps - thanks once again for the examples of required syntax for borland's
> compiler & ms' win32.
In the meantime I got to know these links:
http://www.winprog.org/tutorial/bcpp.html
http://members.aon.at/fraba/ccomp.htm
(Afaik in German only, but with excellent samples)
Regards,
Friedel