Welcome to MSDN Blogs Sign in | Join | Help

Marcelo's WebLog

Improving the world one entity at a time
XmlLite says: error C2146: syntax error : missing ';' before identifier 'IXmlReader'

This is something that I've been asked more than once, and so here goes an answer that might help if you run into this.

Let's say that you create a new project and borrow code or do something of the sort, and suddenly start getting an error message such as this one

xmllite.h(49) : error C2146: syntax error : missing ';' before identifier 'IXmlReader'

This typically points to a missing macro. You can fix this by adding this to your include headers:

#include "objbase.h"

If you're using Visual C++-style projects, this may already be included via stdafx.h including the Windows headers for you.

 

Posted: Friday, June 05, 2009 2:00 PM by marcelolr
Filed under: , ,

Comments

uabix said:

Hi,

I have this problem with the error c2146 in VC++.

Although I'm tying to create a simple dll file (means that I already have stdafx.h icluded )the error keeps coming up.Actually I'm trying to create a dll file using a library created in C with header files.That means I'm trying to get a dll file using a xxxx.c file,a xxxx.h file and a yyyy.h file.

I've been searching the net for days,trying to find a solution,but nothing helped me so far.

Any help would be appreciated.

Thx a lot.

# June 11, 2009 10:33 PM

marcelolr said:

uabix, can you share the error message that you get, and the headers that are in the .c and stdafx.h files?

# June 13, 2009 10:26 PM
New Comments to this post are disabled
Page view tracker