Error messages in dev cpp

Hey I am getting this error message that is not allowing me to run my program. CAN SOMEONE HELP


[Linker error] C:\Users\Alex\AppData\Local\Temp\cck6wqNl.o:COS143Assignment.cpp:(.text+0x65d): undefined reference to `writeOutAll(CellphoneInfo*, int)'

collect2: ld returned 1 exit status
Did you define writeOutAll anywhere?
You are trying to use a function named writeOutAll that takes in a pointer-to-CellphoneInfo and an int.

Sadly, this function either does not exist, or you are not linking to it.
How should I link it

1
2
3
const int size = 100;
CellphoneInfo *cellphonePtr;  
cellphonePtr = new CellphoneInfo [size];



1
2
3
4
5
6
7
8
9
10
void writeOut(CellphoneInfo arr [],int number)
{
	cout << fixed << showpoint << setprecision(2);
	ofstream dataFile;
	dataFile.open("Inventory.txt",ios::out|ios::app);
	dataFile << arr[number].name << "#" << arr[number].manu << "#" << arr[number].cellDesign << "#" << arr[number].internalMem << "#" << arr[number].camera << "#" << arr[number].os << "#" << arr[number].costPrice << "  #" << endl; 
	dataFile.close();
	
	cout << "Record successfully written to file\n";
}

That's a different function, writeOut.
It isn't writeOutAll.
Last edited on
Topic archived. No new replies allowed.