怎么会有两个error呢,请大虾帮忙
// 8848.cpp : Defines the entry point for the console application.
//Linking...
8848.obj : error LNK2001: unresolved external symbol "bool __cdecl fibon_elem(int,int &)" (?fibon_elem@@YA_NHAAH@Z)
Debug/8848.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
8848.exe - 2 error(s), 0 warning(s)
#include "stdafx.h"
#include <iostream>
using namespace std;
bool fibon_elem(int ,int &);
int main(int argc, char* argv[])
{
int pos;
cout << "please enter a postion: ";
cin >> pos;
int elem;
if (fibon_elem(pos,elem))
cout << " element # "<< pos
<< " is " << elem << endl;
else cout << "sorry, could not calculate element # "
<< pos << endl;
bool fibon_elem(int pos,int &elem);
{ //检查位置值合理否
if ( pos <= 0 || pos > 1024 )
{ elem =0 ;return false;}
elem =1;
//位置为1和2时候,elem的值都为1
int n_1=1, n_2=1;
for (int ix =3; ix <= pos; ++ix)
{
elem =n_1+n_2;
n_2=n_1;n_1 =elem;
}
return true ;
}
}