[Shapelib] Hellp Please with unix compilation

elena at velocitus.net elena at velocitus.net
Thu Jan 27 15:17:09 EST 2005


I am trying to compiled dbfopen.cpp as part of a project. when I try to
compile it I get the following error

c++ ISO forbifd cast to nonreference type used as lvalue in the following
line (marked with number 1) I get several of this errors

DBFHandle SHPAPI_CALL DBFCloneEmpty(DBFHandle psDBF, const char* pszFilename)


	DBFHandle newDBF;

	newDBF = DBFCreate(pszFilename);

	if (newDBF == NULL)

		return (NULL);

1)	((void *) newDBF->pszHeader) = (void *) malloc(32 * psDBF->nFields);

	memcpy(newDBF->pszHeader, psDBF->pszHeader, 32 * psDBF->nFields);

	newDBF->nFields = psDBF->nFields;

	newDBF->nRecordLength = psDBF->nRecordLength;

	newDBF->nHeaderLength = psDBF->nHeaderLength;

	((void *) newDBF->panFieldOffset) = (void *)

		malloc(sizeof(int) * psDBF->nFields);

	memcpy(newDBF->panFieldOffset, psDBF->panFieldOffset,

		sizeof(int) * psDBF->nFi

can anyone help me I am using gcc 3.4.1 to compile the code

Thank you very much

More information about the Shapelib mailing list