Readme file for using Watcom C/C++32 compiler version 9.5 to build user DLLs for Mathcad To build a sample: (samples are under SOURCES subdirectory of your compiler directory) Each sample has a compile.bat and a link.bat file associated with it. To build a sample project just call these files in sequence. When using Watcom for the first time you should keep in mind the following points: a) The compiler crashes if EMM386 memory manager is installed. So take it out of your config.sys or autoexec.bat file if you have it. b) Make sure your include path includes watcom\h\nt;watcom\h;mstools\h where mstools\h contains the include files from Microsoft's WIN32 SDK (Watcom does not provide the Microsoft files). c) You have to compile using stack based argument passing conventions. This is done by using the compiler directive /3s or /4s depending on whether you have a 386 or 486 processor. d) Running Watcom under DOS you need to set the path environment variable so that it includes watcom\bin;watcom\binb. Running under NT you have to set the user environment variables so that the path includes watcom\binnt;watcom\binb. e) DLL entry point function has to be called LibMain. f) Default structure alignment is 1 byte. You have to set it to 8 by the directive /zp8. g) We have not provided an import library for MCADUSER.DLL because we had problems generating NT import libraries using the Watcom librarian WLINK. Therefore, the functions in MCADUSER.DLL are demand-loaded. Because of this the include file and the sources for Watcom are significantly different from the others. h) For more information see the sample source files and the readme.txt file in USEREFI subdirectory. TYPICAL COMMAND LINES: A typical compile line command for Watcom is: wcc386 /bd /3s /bt=nt /zp8 /i=c:\winmcad\userefi\watcom\include filename.c or, in relative notation for the samples, wcc386 /bd /3s /bt=nt /zp8 /i=..\..\include filename.c /bd is for building a DLL; /3s so it uses stack based calling convention using 386 instructions; /bt=nt indicates we are building a 32 bit DLL; /zp8 causes 8 byte alignment of non-character members within structures; /i= indicates the path where the include files might be (in this case path for MCADINCL.H for Watcom) and filename is the name of the file being compiled. A typical link line command for Watcom is: wlink system nt_dll initinstance terminstance file {file1.obj file2.obj} name c:\winmcad\userefi\DLLname.dll or, in relative notation for the samples, wlink system nt_dll initinstance terminstance file {file1.obj file2.obj} name ..\..\..\DLLname.dll system nt_dll indicates we are building a 32 bit DLL; initinstance and terminstance are needed if you link with any runtime libraries; file1 and file2 are the names of the object files to be linked; DLLname is the name of the DLL to be built (this is optional and if not present it will use the name of the first object file for DLLname)