newlib-cygwin/winsup/mingw/samples/dlltest/readme.txt

40 lines
1.9 KiB
Plaintext
Raw Normal View History

2000-02-18 03:38:33 +08:00
This directory contains two examples of building DLLs. The exe.c and dll.c
files are used to build a very simple example DLL with a function that
adds two numbers together (and prints some text at the same time). The
exe.c program links to the DLL and prints the results of the function
call.
The C++ example "silly" is more interesting because it involves a DLL which
contains the code for a C++ class. The CSilly class has all of its code in
the sillydll.cpp source file, which is used to build the silly.dll. The
silly.cpp source code builds the main silly.exe executable which makes a
dynamic instance of the object and calls its member functions.
The C++ silly.def file was generated by doing a nm of sillydll.o after it
was generated and then getting the symbol names from that. Removing the
leading underscore produces the appropriate name to include in the EXPORTS
section. Notice there are a few weird functions.
Since there are now several different versions of the GNU compiler capable
of doing this, and they each seem to have different requirements for exports
for classes, it has gotten kind of messy. The silly.def file here is for
use with the native Mingw32 build of the EGCS version of GCC. The silly.def.old
file was the def file I used when I was using Jan-Jaap's Mingw32 native port
of GCC. The Cygnus version is different again, if I recall correctly, but I
don't have it hanging around anymore.
The jamfile builds all the components from the raw sources.
The expected output of exe.exe and silly.exe are in the files exe.exp
and silly.exp.
The source code in this directory is in the PUBLIC DOMAIN and can be
used or abused as you see fit. There is NO WARRANTY for this code,
including (but not limited to) implied warranties of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.
Colin Peters <colin@bird.fu.is.saga-u.ac.jp>