I am attempting to compile some old code - it is in both C and F, and keeps falling over when I try to create .obj files in cMbedded visual C++ v 4;
warning C4013: 'perror' undefined; assuming extern returning int
Code:
#include "soilwater.h"
#include <stdlib.h>
#include <stdio.h>
void initsite(char *sitename, SITEPAR_SPT sitepar, LAYERPAR_SPT layers,
FLAG_SPT flags)
{
int imo, m;
char inptline[INPTSTRLEN];
char errmsg[INPTSTRLEN];
FILE *fp_in;
if (flags->debug) {
printf("Entering function initsite\n");
}
if ((fp_in = fopen(sitename, "r")) == NULL) {
sprintf(errmsg, "Cannot open file %s\n", sitename);
perror(errmsg);
exit(1);
}
I don't know if there is an error in the code or if an appropriate libry is missing? any help gratefully appreciated
Amy