So I have been getting this error for a while. I have looked through my code but cannot fine the issue. The full error I get is
1>ConsoleApplication132.obj : error LNK2019: unresolved external symbol "void __cdecl DNAtoRNA(char)" (?DNAtoRNA@@YAXD@Z) referenced in function _main
This is my code:
// Program uses wave data to calcuulate steepness and average steepness for the year
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <cctype>
#include <string>
using namespace std;
struct DNAnt{
int adenine, cytosine, guanine, thymine;
string strand;
char allDNA[100][80];
};
void data2DNA(int * , int * , int * , int * , string);
void countDNA(int * , int * , int * , int * , string , bool *);
void DNAtoRNA(char );
int main()
{
DNAnt DNA;
data2DNA(&DNA.adenine, &DNA.cytosine, &DNA.guanine, &DNA.thymine, DNA.strand);
ifstream inputFile;
inputFile.open("C:\\Users\\mjass_000\\Desktop\\DNA.txt");
for(int y=0; y<80; y++){ //inputting information into array
for(int x=0; x<100; x++){ //-----
inputFile >> DNA.allDNA[x][y]; //-----
} //-----
} //-----
DNAtoRNA(DNA.allDNA[100][80]);
inputFile.close();
cin.get();
return 0;
}
void data2DNA(int *adenine, int *cytosine, int *guanine, int *thymine, string strand){
ifstream inputFile;
inputFile.open("C:\\Users\\mjass_000\\Desktop\\data.txt");
ofstream outputFile;
outputFile.open("C:\\Users\\mjass_000\\Desktop\\DNA.txt");
int number, numA=0, numC=0, numG=0, numT=0, count=0;
bool end=false;
while (inputFile >> number){
if(number==1){
strand="A";
outputFile << strand; //outputting to file
countDNA(&numA, &numC, &numG, &numT, strand, &end);
count++;
}else if(number==2){
strand="C";
outputFile << strand;
countDNA(&numA, &numC, &numG, &numT, strand, &end);
count++;
}else if(number==3){
strand="G";
outputFile << strand;
countDNA(&numA, &numC, &numG, &numT, strand, &end);
count++;
}else if(number==4){
strand="T";
outputFile << strand;
countDNA(&numA, &numC, &numG, &numT, strand, &end);
count++;
}
if(count==10000){ //if it is the last number
end=true;
*adenine=numA;
*cytosine=numC;
*guanine=numG;
*thymine=numT;
}
}
outputFile.close();
inputFile.close();
return;
}
void countDNA(int *numA, int *numC, int *numG,int *numT, string strand, bool *end){
if(strand=="A"){
*numA+=1;
}else if(strand=="C"){
*numC+=1;
}else if(strand=="G"){
*numG+=1;
}else if(strand=="T"){
*numT+=1;
}
return;
}
void DNAtoRNA(char allDNA[100][80]){
ofstream outputFile;
outputFile.open("C:\\Users\\mjass_000\\Desktop\\RNA.txt");
int totalT=0;
for(int y=0; y<80; y++){
for(int x=0; x<100; x++){
if(allDNA[x][y]=='T'){
totalT++;
}
}
if(totalT>25){ //if there are more than 25 T's
for(int x=0; x<100; x++){ //-----
if(allDNA[x][y]=='T'){ //-----
outputFile << "U"; //-----
}else{ //-----
outputFile << allDNA[x][y]; //-----
} //-----
} //-----
}else{ //-----
for(int x=0; x<100; x++){
outputFile << allDNA[x][y];
}
}
totalT=0;
outputFile << endl;
}
outputFile.close();
return;
}