main.c
main.c
is used to create the executable that uses the dll.
#include <stdio.h>
#include "dll.h"
int main() {
printf("18+24 = %d\n", add(18, 24));
}
Makefile
This make file (to be invoked with nmake
) creates the dll and the executable that uses the dll.
all: the.dll main.exe
main.exe: main.c
@cl /nologo main.c the.lib
the.dll: dll.obj
@link /nologo /dll dll.obj /def:dll.def /out:the.dll
dll.obj: dll.c
@cl /nologo /c dll.c /Fodll.obj
clean:
@if exist *.obj del *.obj
@if exist *.dll del *.dll
@if exist *.exe del *.exe
@if exist *.exp del *.exp
@if exist *.lib del *.lib