- Two files: one c file and one .def file
- The contents of main.c are as follows:
#include <windows.h>
#include <stdio.h>
int sub(int a, int b) {
return a - b;
}
int add(int a, int b) {
return a + b;
}
- The contents of main.def are as follows:
LIBRARY dll_with_def
EXPORTS
add @1
sub @2
Reference Links
1.https://docs.microsoft.com/en-us/cpp/build/exporting-from-a-dll-using-def-files?view=msvc-170