Visual C ++ 2008, errors with #include "afxdb.h"

I have a problem using adxdb.h:

I tried

#include "afxdb.h"

But I got this error:

C: \ Program Files \ Microsoft Visual Studio 9.0 \ VC \ atlmfc \ include \ afx.h (24): fatal error C1189: #error: Creating an MFC application with / MD [d] (DLL version for CRT) requires MFC general version dll. Please #define _AFXDLL or do not use / MD [d]

Then i added

#define _AFXDLL

As reported in the error message, and got a dozen errors:

C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afxole.h(1455): C2504: 'CControlBar': undefined
1 > C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afxole.h(1470): C2146: : ';' 'm_tracker'
1 > C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afxole.h(1470): C4430: - int. : ++ default-int 1 > C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afxole.h(1470): C4430: - int. : ++ default-int 1 > C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afxpriv.h(590): C2504: 'CControlBar': undefined

, ? Visual ++

+3
3

#define _AFXDLL, : | | | MFC , MFC DLL.

+5

, Projects- > Proprties- > > Generation- > Use MFC: MFC DLL.

(Visual Studio 2013) !

+1

I had the same problem, and to solve it I had to make sure that:

#include <afxcmn.h>

:

#include <afxdb.h>

So:

#include <afxcmn.h>
#include <afxdb.h>

Good and:

#include <afxdb.h>
#include <afxcmn.h>

Poorly.

0
source

All Articles