Hello...this is my first time posting here, so if I screw up the code tags or something....
Okay, I'm having trouble getting multiple files to compile with Borland C++Builder 4.0 I followed my school textbook example, but it doesn't give compiler specific instructions. I've tried adding all the files to a project, but I get this error:
[Linker Error] Unresolved external 'GetSum(int, int)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER4\PROJECTS\FUNCTION\FUNCTION .OBJ
Here is the code:
Code:
//main.cpp
#include <iostream.h>
#include <conio.h>
#include "test.h"
int main()
{
int num1=5;
int num2=5;
int sum;
sum=GetSum(num1,num2);
cout << sum;
getch();
return 0;
}
Code:
//getsum.cpp
#include "test.h"
int GetSum(int num1, int num2)
{
int sum;
sum=num1+num2;
return sum;
}
Code:
//test.h
#ifndef SUM
int GetSum(int num1, int num2);
#define SUM
#endif
Is there a problem with my code, or am I not doing something to compile or link it right? If anyone has experience with C++Builder 4, I could really use your help with this. Thanks.