Trouble compiling with Expat
Posted on 2006-04-27
I need to create a program to parse an XML file. I'm trying to us Expat, but have been having problems compiling my program.
I'm sure it's either a minor set-up problem or my old version of Microsoft Developer Studio 97 that I am using.
The code I am trouble with is:
int main(int argc, char* argv)
/* open log file in append mode */
f_in = fopen("c:\\xml\test.xml","a+");
if(f_in == NULL)
printf("Error opening log file");
XML_Parser p = XML_ParserCreate(NULL);
/* close file */
As you can see I haven't got very far!!
The errors I get are:
C:\XML\XML.c(20) : error C2275: 'XML_Parser' : illegal use of this type as an expression
C:\XML\XML.c(20) : error C2146: syntax error : missing ';' before identifier 'p'
C:\XML\XML.c(20) : error C2065: 'p' : undeclared identifier
C:\XML\XML.c(20) : warning C4047: '=' : 'int ' differs in levels of indirection from 'struct XML_ParserStruct *'
I'm probably be very dim. But your help would be appreciated.
Thanks in advance