Welcome to mirror list, hosted at ThFree Co, Russian Federation.

readme.txt « dlltest « samples « mingw « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3d310132623a7887f0f9501b9cdcd872e056f472 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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>