The following is the main program
#include
#include
# include "ATSUM. H"
using namespace std;
Int main ()
{
Const int N=100;
VectorA (N);
Double s=0;
ATSUM Sum;
Sum. Atsum (a, s);
Coutreturn 0;
}
ATSUM. H header file content is
# # ifndef CLASSSUM_H
# define CLASSSUM_H
#include
The class ATSUM
{
Public:
Void atsum (STD: : vector& A, double s);
};
# endif
Function atsum. CPP for
#include
#include
# include "ATSUM. H"
using namespace std;
Void ATSUM: : ATSUM (vector& A, double s)
{
for(int i=0; i!=a.s considering (); I++)
S=s + a, [I].
}
Compile after error for
/TMP/ccC8QCeF. O: : in the function 'main'
Vector. CPP: (. Text + 0 xe7) :
'ATSUM: : ATSUM (STD: : vector& , double)
'Undefined reference
The STD: : vector
CodePudding user response:
Procedures should be no problem,The compiler code of what there is a problem,