I've been given a DLL ( and .h file) that is used to read a certain type of files.
These are the instructions provided in the help file:

Qt Code:
  1. DataIO is supplied as a DLL. Incorporating this into a C++ program requires three files:
  2.  
  3. DataIO.DLL This is the dynamic link library file supplied with the SDK.
  4. This should be located in a path visible to your program (i,e, in the same directory as your
  5. .EXE file or in the WINDOWS\SYSTEM32 directory of your computer.
  6.  
  7. DataIO.LIB This must be created from DataIO.DLL using the utility supplied with your compiler
  8. (IMPLIB.EXE in the case of Borland). DataIO.LIB must be linked with your program.
  9.  
  10. DataIO.H This is the header file containing the definitions of all the procedures, structures
  11. etc. used in DataIO. This must be included in any code file using the SDK. Note the
  12. TOPDIO definition described below.
  13.  
  14.  
  15.  
  16. This simple code fragment shows how this is done:
  17.  
  18.  
  19. #include <stdio.h> // for I/O routines in this fragment
  20. #include <windows.h> // This is required (may be implicit in other
  21. // headers such as vcl.h)
  22. #define TOPDIO // This statement MUST precede the DataIO.h include
  23. // in ONLY ONE file of your program
  24. #include "Dqp_DataIo.h" // Include the DataIO definitions
  25.  
  26.  
  27. int main(int argc, char* argv[])
  28. {
  29. //...not important
  30. }
To copy to clipboard, switch view to plain text mode 

After much hair-pulling, googling and IRC...ing I managed to figure out how to create the .lib file: first create a .ref file using Borland's impdef.exe tool, then create the .lib using MinGW's dlltool.exe

So now I have DataIO.lib added into my .pro file using: LIBS += DataIO.lib
but when I follow the instructions above and include the Dqp_DataIo.h file I get TONS of compiler errors... ranging from multiple [ 'WORD' does not name a type ] or [ 'DWORD' does not name a type ] errors spawning from a struct with members of (apparently) type WORD (and DWORD) without a typedef... to [ ISO C++ forbids declaration of 'blah' with no type ]


The header file is huge (~1200 lines) and I know I shouldn't be messing around with it so is there any way to alleviate these errors? Maybe changing some compiler options??

Any help would be greatly appreciated!!