I need help to compile a script (\"iterator.c\") into a DLL. I can\'t use VS2010 since it does not support the features added to C in the C99 standard (I\'m
You must place __declspec(dllexport) in front of the method you wish to export such as, you could #define this to max it easier
EXPORT_DLL void hello() { ... }
To compile the dll use
gcc -c -mno-cygwin mydll.c
gcc -shared -o mydll.dll mydll.o -Wl,--out-implib,libmylib.dll.a
then to attach
gcc -o myexe.exe test.o mydll.dll
EDIT: Forgot the most important piece, you need to make a mydll.h file to include your method definition so the compiler knows to reserve a spot for the linker to fill in later on. It's as simple as
#ifndef MYDLL_H
#define MYDLL_H
extern "C" __declspec(dllexport)
#define EXPORT_DLL __declspec(dllexport)
EXPORT_DLL void hello();
#endif