DLL syntax error
I'm trying to create a dll with multiple functions, in Visual C++ 2010,
and I keep getting a syntax error that is related to using strings, or so
it seems.
1>c:\users\new\documents\visual studio
2010\projects\getint\getint\getint.h(9): error C2061: syntax error :
identifier 'string'
The code can be seen below. I literally followed what I did last time;
although the last dll I made had 1 function and no boolean or string
values.
#include <string>
class getInt
{
public:
//NB :: static __declspec(dllexport) is need to export data from the dll!
//This declares the function for retrieving an integer value from the
user
static __declspec(dllexport) int toInt (const string &inStr);
static __declspec(dllexport) int getNum();
static __declspec(dllexport) bool isValidInt (const string& str);
};
There are several other syntax errors but I believe they are arising due
to the string being before the other functions.
No comments:
Post a Comment