Also, fix these calls:
data(a[5][3]);
calc(a[5][3]);
HL(a[5][3]);
Because you are referencing an inexistent element in matrix a
. Either you'll pass an undefined value, or you will get a segfault.
Remember that the last element of your a
matrix is a[4][2]
. If your intention was to pass all the matrix to your function, and not a single element, you have to redefine your prototypes and use only the matrix name a
as the argument.
The "undefined symbol" the linker refers to are your functions data
, calc
and HL
. The three of them are used in your main()
function as functions that expects a single float value to work with. So are your prototypes.
But your implementation uses matrices as arguments, not floats. A C compiler should complain about wrong type argument used in functions data
, calc
and HL
, but a C++ compiler will interpret it as data
, calc
and HL
being overloaded functions, so they may have more than one implementation. You provide one of them (with a matrix as argument), but the compiler needs the other one (with a float as argument). The linker is responsible to find all the used implementations of a overloaded function. As it cannot find them, it throws that error.