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:
DataIO is supplied as a DLL. Incorporating this into a C++ program requires three files:
DataIO.DLL This is the dynamic link library file supplied with the SDK.
This should be located in a path visible to your program (i,e, in the same directory as your
.EXE file or in the WINDOWS\SYSTEM32 directory of your computer.
DataIO.LIB This must be created from DataIO.DLL using the utility supplied with your compiler
(IMPLIB.EXE in the case of Borland). DataIO.LIB must be linked with your program.
DataIO.H This is the header file containing the definitions of all the procedures, structures
etc. used in DataIO. This must be included in any code file using the SDK. Note the
TOPDIO definition described below.
This simple code fragment shows how this is done:
#include <stdio.h> // for I/O routines in this fragment
#include <windows.h> // This is required (may be implicit in other
// headers such as vcl.h)
#define TOPDIO // This statement MUST precede the DataIO.h include
// in ONLY ONE file of your program
#include "Dqp_DataIo.h" // Include the DataIO definitions
int main(int argc, char* argv[])
{
//...not important
}
DataIO is supplied as a DLL. Incorporating this into a C++ program requires three files:
DataIO.DLL This is the dynamic link library file supplied with the SDK.
This should be located in a path visible to your program (i,e, in the same directory as your
.EXE file or in the WINDOWS\SYSTEM32 directory of your computer.
DataIO.LIB This must be created from DataIO.DLL using the utility supplied with your compiler
(IMPLIB.EXE in the case of Borland). DataIO.LIB must be linked with your program.
DataIO.H This is the header file containing the definitions of all the procedures, structures
etc. used in DataIO. This must be included in any code file using the SDK. Note the
TOPDIO definition described below.
This simple code fragment shows how this is done:
#include <stdio.h> // for I/O routines in this fragment
#include <windows.h> // This is required (may be implicit in other
// headers such as vcl.h)
#define TOPDIO // This statement MUST precede the DataIO.h include
// in ONLY ONE file of your program
#include "Dqp_DataIo.h" // Include the DataIO definitions
int main(int argc, char* argv[])
{
//...not important
}
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!!
Bookmarks