I am new to C++ and trying to use a 3rd party DLL to communicate with a memory card reader.
The 'McardAPI.h' that I am including in my simple class, uses the SCARDHANDLE in its typedefs (also some more errors but they are all the same type):
typedef SCARDHANDLE MCARDCONTEXT;
There is a .dll and .lib file provided by the 3rd party. I have put the .dll in the C:\Dev-Cpp\bin directory and put the .lib file in the C:\Dev-Cpp\lib directory. In the Project Options, Parameters, Linker options I have specified the MCSCM.lib file. I have also included
C:\Dev-Cpp\bin
C:\Dev-Cpp\lib
C:\Dev-Cpp\include
in the Project Options, Directories, Library Directories.
But I still keep getting the error messages:
10 C:\Dev-Cpp\include\McardAPI.h `SCARDHANDLE' does not name a type
And a few more of the same type of errors. See full log below.
Full log:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Examples\Hello\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Examples\Hello\Makefile.win" all
g++.exe -DDEBUG -c Hello.cpp -o Hello.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/WINDOWS/SYSTEM32" -I"C:/Dev-Cpp/include" -ansi -g3
In file included from Hello.cpp:4:
C:/Dev-Cpp/include/McardAPI.h:10: error: SCARDHANDLE' does not name a type
C:/Dev-Cpp/include/McardAPI.h:11: error: expected init-declarator before '*' token
C:/Dev-Cpp/include/McardAPI.h:11: error: expected,' or ;' before '*' token
C:/Dev-Cpp/include/McardAPI.h:16: error:SCARDHANDLE' does not name a type
C:/Dev-Cpp/include/McardAPI.h:17: error: expected init-declarator before '' token
C:/Dev-Cpp/include/McardAPI.h:17: error: expected ,' or;' before '' token
Hello.cpp:6: error: SCARDCONTEXT' does not name a type
Hello.cpp:8: error:MCARDCONTEXT' does not name a type
Hello.cpp: In function int main(int, char**)':
Hello.cpp:20: error:ContextHandle' undeclared (first use this function)
Hello.cpp:20: error: (Each undeclared identifier is reported only once for each function it appears in.)
Hello.cpp:20: error: hMCardContext' undeclared (first use this function)
Hello.cpp:20: error:MCardInitialize' undeclared (first use this function)
make.exe: *** [Hello.o] Error 1
Execution terminated
Is there somewhere else the .lib files need to be included or what else do I need to do?
Thanks in advance for any help you can provide on this!
Cheers!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am using DevC++ 4.9.9.2 on Windows XP.
I am new to C++ and trying to use a 3rd party DLL to communicate with a memory card reader.
The 'McardAPI.h' that I am including in my simple class, uses the SCARDHANDLE in its typedefs (also some more errors but they are all the same type):
typedef SCARDHANDLE MCARDCONTEXT;
There is a .dll and .lib file provided by the 3rd party. I have put the .dll in the C:\Dev-Cpp\bin directory and put the .lib file in the C:\Dev-Cpp\lib directory. In the Project Options, Parameters, Linker options I have specified the MCSCM.lib file. I have also included
C:\Dev-Cpp\bin
C:\Dev-Cpp\lib
C:\Dev-Cpp\include
in the Project Options, Directories, Library Directories.
But I still keep getting the error messages:
10 C:\Dev-Cpp\include\McardAPI.h `SCARDHANDLE' does not name a type
And a few more of the same type of errors. See full log below.
Full log:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Examples\Hello\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Examples\Hello\Makefile.win" all
g++.exe -DDEBUG -c Hello.cpp -o Hello.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/WINDOWS/SYSTEM32" -I"C:/Dev-Cpp/include" -ansi -g3
In file included from Hello.cpp:4:
C:/Dev-Cpp/include/McardAPI.h:10: error:
SCARDHANDLE' does not name a type C:/Dev-Cpp/include/McardAPI.h:11: error: expected init-declarator before '*' token C:/Dev-Cpp/include/McardAPI.h:11: error: expected
,' or;' before '*' token C:/Dev-Cpp/include/McardAPI.h:16: error:
SCARDHANDLE' does not name a typeC:/Dev-Cpp/include/McardAPI.h:17: error: expected init-declarator before '' token
C:/Dev-Cpp/include/McardAPI.h:17: error: expected
,' or
;' before '' tokenHello.cpp:6: error:
SCARDCONTEXT' does not name a type Hello.cpp:8: error:
MCARDCONTEXT' does not name a typeHello.cpp: In function
int main(int, char**)': Hello.cpp:20: error:
ContextHandle' undeclared (first use this function)Hello.cpp:20: error: (Each undeclared identifier is reported only once for each function it appears in.)
Hello.cpp:20: error:
hMCardContext' undeclared (first use this function) Hello.cpp:20: error:
MCardInitialize' undeclared (first use this function)make.exe: *** [Hello.o] Error 1
Execution terminated
Is there somewhere else the .lib files need to be included or what else do I need to do?
Thanks in advance for any help you can provide on this!
Cheers!
How is MCARDCONTEXT defined?
Post about the first 20 lines of McardAPI.h.