fork(1) download
  1. /*
  2.   test_caller.cpp
  3. */
  4.  
  5. #include <windows.h>
  6. #include <stdio.h>
  7.  
  8. #include "test_dll.h"
  9.  
  10. #define LIBNAME "test_dll.dll"
  11.  
  12. #define FUNC_TEST "test"
  13. typedef int (WINAPI *func_test)(int);
  14.  
  15. int main(int ac, char **av)
  16. {
  17. HMODULE hmodule = LoadLibrary(LIBNAME);
  18. if(!hmodule){
  19. fprintf(stderr, "cannot load module: %s\n", LIBNAME);
  20. return 1;
  21. }
  22. func_test test = (func_test)GetProcAddress(hmodule, FUNC_TEST);
  23. if(!test){
  24. fprintf(stderr, "cannot get proccess: %s\n", FUNC_TEST);
  25. return 2;
  26. }
  27. fprintf(stdout, "test: %d\n", test(6));
  28. FreeLibrary(hmodule);
  29. return 0;
  30. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:5:21: fatal error: windows.h: No such file or directory
 #include <windows.h>
                     ^
compilation terminated.
stdout
Standard output is empty