Build Errors! LNK2019 and LNK1120! Please Help!

Hello! I am trying to write a code for a Caesar Cipher and have never seen these two errors before. The program compiles, but fails upon running and building due to two source errors. The code is:

#include<iostream>
#include<fstream>
#include<cstring>
#include<string>
using namespace std;

void printFunc(char print[], ofstream&);
void initialFunc();
void caesar_cipher (char [], int, int, int, char []);
void caesar_cipher (char [], int, int&, char []);
void rotate_right (char [], int, int&);
void rotate_left (char [], int, int&);
void rotate_letter (char [], int, int&);


int main ()
{
ifstream in_stream;
ofstream out_stream;

in_stream.open ("input1.txt");
out_stream.open ("input1_output.txt");

if (in_stream.fail())
cout << "Error opening file" << endl;

char input[200];

in_stream.getline(input,200);

int count = 0;
while (input[count] != '\0')
{
count++;
}

printFunc(input, out_stream);

char array_a[27];
strcpy_s (array_a, "abcdefghijklmnopqrstuvwxyz");
initialFunc();

int rot_amount = 0;

caesar_cipher(input, count, rot_amount, array_a);



}

void printFunc(char print[], ofstream& output)
{
cout << "The message to be coded is " << print;
output << "The message to be coded is " << print;
}

void initialFunc()
{
char array_a[27];
strcpy_s(array_a, "abcdefghijklmnopqrstuvwxyz");

}

void caesar_cipher(char message[], int size, int rot_amount, int rot_dir, char array_a[])
{
}

void caesar_cipher(char message [], int size, int& rot_amount, char array_a)
{
for (int i=0; i < size; i++)
if (message[i]>= 97 && message[i] <= 109)
rotate_right(message, i, rot_amount);
else if (message[i]>=110 && message[i] <= 122)
rotate_left(message, i, rot_amount);
}

void rotate_right (char message[], int i, int& rot_amount)
{
rot_amount = 13;
if (isalpha(message[i]))
rotate_letter(message, i, rot_amount);
}

void rotate_left (char message[], int i, int& rot_amount)
{
rot_amount = -13;
if (isalpha(message[i]))
rotate_letter(message, i, rot_amount);
}

void rotate_letter (char message[], int i, int& rot_amount)
{
message[i] = message[i] + rot_amount;
}




the errors following are:

Error 1 error LNK2019: unresolved external symbol "void __cdecl caesar_cipher(char * const,int,int &,char * const)" (?caesar_cipher@@YAXQADHAAH0@Z) referenced in function _main V:\My Documents\CMPSC 201 Fall 2013\HW5\HW5\Source.obj HW5

Error 2 error LNK1120: 1 unresolved externals V:\My Documents\CMPSC 201 Fall 2013\HW5\Debug\HW5.exe 1 1 HW5



I am stuck on these errors... Please help!
I think your forgot [] for the array of char (last argument) in your second ceasar_cipher declaration.

You're code compile but then it is not able to find the function you're calling. You wrote the prototype properly at the beginning of your code, but you never implemented this function.

Do you see what I mean ?
Topic archived. No new replies allowed.