#include #ifdef WIN32 #include __declspec( dllimport ) void print(); __declspec( dllimport ) int f(); #else void print(); int f(); #endif void (*pPrint)(); int (*pF)(); int main() { #ifdef WIN32 HINSTANCE hLib; hLib = LoadLibrary("dll.dll"); pF = (int (*)(int val))GetProcAddress(hLib,"f"); pPrint = (int (*)(char*))GetProcAddress(hLib,"print"); #else pF = f; pPrint = print; #endif printf("%d\n",pF()); pPrint(); return 0; }