Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why do I get a compilation error on Windows when I create a project using MFC or anything that includes oledb.h?

0
Posted

Why do I get a compilation error on Windows when I create a project using MFC or anything that includes oledb.h?

0

Berkeley DB’s header file db.h and Microsoft’s header file oledb.h both define the symbol DBTYPE. Unfortunately, changing either use of this symbol would break existing code. The first and simplest solution to this problem is to organize your source code so that only one of these two header files is needed in any of your sources. In other words, separate the uses of Berkeley DB and the uses of Microsoft’s OLE DB library so that they are not mixed in your code. Then, just choose either db.h or oledb.h, but do not mix them in one source file. If that is not possible, and you have to mix both headers, wrap one of the #include lines as follows. Find the line where oledb.h is included in your source code. This may be in the automatically-generated stdafx.h include file. Decide whether that header file is really needed.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123