Error : aggregate 'first one' has incomplete type and cannot be defined
问题 I have written this header file (header1.h) : #ifndef HEADER1_H #define HEADER1_H class first ; //int summ(int a , int b) ; #endif and this source files (header1.cpp and main.cpp) : #include <iostream> #include "header1.h" using namespace std; class first { public: int a,b,c; int sum(int a , int b); }; int first::sum(int a , int b) { return a+b; } #include <iostream> #include "header1.h" using namespace std; first one; int main() { int j=one.sum(2,4); cout << j<< endl; return 0; } But when I