I have a piece of C code that is used from a C ++ function. At the top of my C ++ file, I have a line:#include "prediction.h"
In prediction.hI have this:
#ifndef prediction
#define prediction
#include "structs.h"
typedef struct {
double estimation;
double variance;
} response;
response runPrediction(int obs, location* positions, double* observations,
int targets, location* targetPositions);
#endif
I also have prediction.cone that has:
#include "prediction.h"
response runPrediction(int obs, location* positions, double* observations,
int targets, location* targetPositions) {
// code here
}
Now, in my C ++ file (which, as I said, includes prediction.h), I call this function and then compile (via Xcode), I get this error:
"runPrediction (int, location *, double *, int, location *)" referenced:
mainFrame :: replyTo (char *, int) in mainFrame.o
ld: character not found
collect2: ld returned 1 exit status
prediction.c . .cpp. ?