こんにちは、Visual Basic 10 で C++ コードから単純な dll ファイルを作成したいのですが、ここでエラーが発生するのは、この dll の機能が任意の名前を入力し、別のアプリケーションによって呼び出されたときに名前を表示するコードです (どちらもコンソールです)。応用)
//This is demo.h file
#ifdef DEMODLL_EXPORTS
#define DEMODLL_API __declspec(dllexport)
#else
#define DEMO_API __declspec(dllimport)
#endif
namespace Demo
{
class mydemo
{
char name[30];
public:
static DEMODLL_API char getdata(char name);
static DEMODLL_API char displaydata(char name);
};
}
これはdemo.cppファイルです
#include "stdafx.h"
#include "demo.h"
#include <stdexcept>
using namespace std;
namespace Demo
{
char mydemo :: getdata(char name)
char mydemo :: displaydata(char name)
{
return name;
}
}
これらはエラーです
demo.h(13): error C2144: syntax error : 'char' should be preceded by ';'
demo.h(13): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
demo.h(13): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
demo.h(14): error C2144: syntax error : 'char' should be preceded by ';'
demo.h(14): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
demo.h(14): error C2086: 'int Demo::mydemo::DEMODLL_API' : redefinition
demo.h(13) : see declaration of 'Demo::mydemo::DEMODLL_API'
demo.h(14): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
demo.cpp(12): error C2144: syntax error : 'char' should be preceded by ';'
demo.cpp(12): error C2761: 'char Demo::mydemo::getdata(char)' : member function redeclaration not allowed
私を助けてください