fatal error LNK1561: entry point must be defined

Hi,
I'm supposed to write a code for this question

Write C++ class declaration for a class called Vector3D and a code for handling 3 dimensional vector (V=Vx i + Vy j + Vz k ). The initial values for (Vx ,Vy and Vz) will be passed as parameters to the constructor. If there are not given, a default value of 0 is to be used.
Use operator overloading for
 Adding two vectors : V3 = V1 + V2
 Subtracting two vectors V3 = V1 - V2
 Dot product: V3 = V1 * V2
 Compound Assignment: V1+=V2
 Insertion Operator (<<) to print the vector: cout<<V1
 Extraction Operator (>>) to read the vector: cin>>V1

This is my code:

#pragma once
#include<iostream>
using namespace std;
class Vector3D
{ private: double Vx, Vy, Vz;

public:
Vector3D();
Vector3D(double x, double y, double z);
~Vector3D();
friend Vector3D operator + (Vector3D V1, Vector3D V2);
friend Vector3D operator - (Vector3D V1, Vector3D V2);
friend double operator * (Vector3D V1, Vector3D V2);
friend Vector3D operator += (Vector3D V1, Vector3D V2);
friend ostream& operator<<(ostream &out, Vector3D V1);
friend istream& operator>>(istream &in, Vector3D V1);

};


#include "Vector3D.h"


Vector3D::Vector3D()
{ Vx=Vy=Vz=0;
}

Vector3D::Vector3D(double x, double y, double z){
Vx=x;
Vy=y;
Vz=z;
}

Vector3D::~Vector3D()
{
}

Vector3D operator + (Vector3D V1, Vector3D V2){
Vector3D tmp;
tmp.Vx=V1.Vx+V2.Vx;
tmp.Vy=V1.Vy+V2.Vy;
tmp.Vz=V1.Vz+V2.Vz;
return tmp;
}

Vector3D operator - (Vector3D V1, Vector3D V2){
Vector3D tmp;
tmp.Vx=V1.Vx-V2.Vx;
tmp.Vy=V1.Vy-V2.Vy;
tmp.Vz=V1.Vz-V2.Vz;
return tmp;
}

double operator * (Vector3D V1, Vector3D V2){
double tmp;
tmp=(double)(V1.Vx*V2.Vx)+(double)(V1.Vy*V2.Vy)+(V1.Vz*V2.Vz);
return tmp;
}

Vector3D operator += (Vector3D V1, Vector3D V2){
V1.Vx=V1.Vx+V2.Vx;
V1.Vy=V1.Vy+V2.Vy;
V1.Vz=V1.Vz+V2.Vz;
return V1;
}


ostream& operator<< (ostream &out, Vector3D V1)
{
out <<V1.Vx<<'i+'<<V1.Vy<<"j+"<<V1.Vz<<"k"<<endl;
return out;
}

istream& operator>> (istream &in, Vector3D V1)
{
in >> V1.Vx;
in >> V1.Vy;
in >> V1.Vz;
return in;
}
int main()
{
Vector3D V1(2.0 , 3.0 , 4.0);
Vector3D V2(1.5 , 2.0 , 2.5);
Vector3D V3,V4,V5;
double result;
V3 = V1+V2;
V4 = V1-V2;
result = V1*V2;
cout<<"Addition: "<<V3<<endl;
cout<<"Subtraction: "<<V4<<endl;
cout<<"Dot Product: "<<result<<endl;
cin>>V4;
cout<<"V4: "<<V4<<endl;
V4 += V3;
cout<<"V4: "<<V4<<endl;
V5=V1+V2+V3-V4;
cout<<"V5: "<<V5<<endl;
return 0;
}

A few questions,if you please.
Firstly, is the code correct?
Secondly, I think I haven't done the dot product correctly, as if I didn't put the class name in the declaration it would also be considered as operator overloading or not?
Finally, the only error occurred was
1>LINK : fatal error LNK1561: entry point must be defined
1>
1>Build FAILED.


PS. Am not allowed to change anything in the main function.

Thank you in advance for your time.
Topic archived. No new replies allowed.