vs2010 でこのプロジェクトをビルドすると、エラーが発生します。
- 構文エラー: ';' がありません 識別子「b」の前
- エラー C4430: 型指定子がありません - int と見なされます。注: C++ は default-int をサポートしていません
- エラー C4430: 型指定子がありません - int と見なされます。注: C++ は default-int をサポートしていません
エラー C2065: 'b': 宣言されていない識別子
#ifndef _B_H #define _B_H #include <string> class B { public: B(); ~B(); void showfunc(); string b; }; #endif /***************************/ // B.cpp #include <iostream> #include <string> #include "B.h" using namespace std; B::B() { } void B::showfunc() { cout<<b<<endl; } /**************************************/ // main.cpp #include <iostream> // #include "B.h" using namespace std; void main() { }
私を助けてください!