Unresolved external Linker error with visual studio C++
<pre><code>#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
#include &lt;ctime&gt;
#include &lt;cmath&gt;

using namespace std;

void countx(double, int[]);
void initializeArray(int[]);
void printResult(double,double,int,int[]);

void main()


{

int i, count,distF[8];
double x,sum1,sum2;

/* Calculation for X~ (x,0,1) */

srand(time(NULL));
count=0;
sum1=sum2=0.0;
initializeArray(distF);

for(i=1;i&lt;10000;i++)
{

x=(double)(rand())/RAND_MAX;
if(x&gt;.9 &amp;&amp; x&lt;= 1.8)
count++;
countx(x,distF);
sum1 += x;
sum2 += x*x;

}

cout&lt;&lt;"Results for uniform Distribution:\n";
printResult(sum1,sum2,count,distF);

srand(time(NULL));
count=0;
sum1=sum2=0.0;
initializeArray(distF);

for(i=1;i&lt;=10000;i++)
{
x= -(log(1-(double) (rand())/RAND_MAX))/2;
if(x&gt;.9 &amp;&amp; x&lt;=1.8)

countx(x,distF);
sum1+=x;
sum2+=x*x;

}


cout&lt;&lt;"Reuslts for exponential Distribution 2:\n";
printResult(sum1,sum2,count,distF);

/*** Calculations for P(x=1/2)=1 ***/
srand(time(NULL));
count=0;
sum1=sum2=0.0;
initializeArray(distF);

for(i=1;i&lt;=1000;i++)
{
x=.5;
count++;
countx(x,distF);
sum1+=x;
sum2+=x*x;

}

cout&lt;&lt;"Reuslts for exponential Distribution 3:\n";
printResult(sum1,sum2,count,distF);

srand(time(NULL));
count=0;
sum1=sum2=0.0;
initializeArray(distF);
double temp;

for(i=1;i&lt;=10000;i++)
{
temp=(double)(rand())/RAND_MAX;
if(temp&lt;=.5)
x=.25;
else
x=1.50;
if(x&gt;.9 &amp;&amp; x&lt;=1.8)
count++;
countx(x,distF);
sum1 += x;
sum2 +=x*x;
}

cout&lt;&lt;"Reuslts for Distribution #4:\n";
printResult(sum1,sum2,count,distF);

/*Function*/

void countx(double x, int distF[]);
{
int j=0;
double t= -0.25;
do
{
if(x&lt;=t)
{
for(int k=j;k&lt;8;k++)
distF[k]++;
break;
}
t += .25;
j++;
}
while(t&lt;=1.50);
//return;
}

void intializeArray(int distF[]);
{
for(int j=0;j&lt;8;j++)
distF[j]=0;
//return;
}


void printResult(double sum1, double sum2, int count, int distF[]);
{
double ev_x,var_x,pr_x;
ev_x=sum1/10000;
var_x=sum2/10000-(ev_x * ev_x);
pr_x=(double)(count)/10000;

cout&lt;&lt;"Expected value: " &lt;&lt;ev_x&lt;&lt;endl;
cout&lt;&lt;"Variance: "&lt;&lt;var_x&lt;&lt;endl;
cout&lt;&lt;"P(0.9&lt;x&lt;=1.8):" &lt;&lt;pr_x&lt;&lt;endl;

cout&lt;&lt;"t=";
for(int k=-1; k&lt;7;k++)
cout&lt;&lt;.25 *k&lt;&lt;"\t";
cout&lt;&lt;"lnFx(t)=";
for(int j=0;j&lt;8;j++)
cout&lt;&lt;(double)(distF[j])/10000&lt;&lt;"\t";
cout&lt;&lt;endl;
//return;
}

}
</code></pre>

<p>Need help! Using Microsoft Visual Studio 2012</p>

<pre><code>&gt;kikii.obj : error LNK2019: unresolved external symbol "void __cdecl printResult(double,double,int,int * const)" (?printResult@@YAXNNHQAH@Z) referenced in function _main
1&gt;kikii.obj : error LNK2019: unresolved external symbol "void __cdecl countx(double,int * const)" (?countx@@YAXNQAH@Z) referenced in function _main
1&gt;kikii.obj : error LNK2019: unresolved external symbol "void __cdecl initializeArray(int * const)" (?initializeArray@@YAXQAH@Z) referenced in function _main
</code></pre>
