Visual C++ 2010 で複数の関数を使用して dll を作成しようとしていますが、文字列の使用に関連する構文エラーが発生し続けます。
1>c:\users\new\documents\visual studio 2010\projects\getint\getint\getint.h(9): error C2061: syntax error : identifier 'string'
コードは以下で見ることができます。私は文字通り、前回行ったことに従いました。私が作成した最後のdllには1つの関数があり、ブール値または文字列値はありませんでした.
#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);
};
他にもいくつかの構文エラーがありますが、文字列が他の関数の前にあるために発生していると思います。