Why can't Visual Studio 2008 locate afxcontrolbars.h?
Asked Answered
I

2

9

I have installed VS 2008. When I try to build a project, I am getting an error saying:

Cannot open include file: 'afxcontrolbars.h': No such file or directory

So, I guess I need to have ribbon controls installed for this. Could you please tell me where the SDK is available for download? A link would be very helpful; I googled for it myself, but I could not find it. :(

Impaction answered 11/3, 2011 at 9:9 Comment(2)
Did you install Visual Studio 2008 Express?Cardinalate
These are part of the MFC Feature Pack, I believe, that was first distributed in SP1.Actinal
C
9

This seems like a weird problem to me. afxcontrolbars.h is certainly included in a standard VS 2008 installation. The only way you might be missing MFC components is if you installed the Express version, which doesn't come with support for MFC.

The first thing I would do is check to see if I could create and compile a brand new, blank MFC app using one of the built-in templates. If that works, there's something wrong with your project's properties.

Also check manually in the \Microsoft Visual Studio 9.0\VC\atlmfc\include directory to see if you can locate the header file before you try to manually re-install the platform SDK. It may be as simple as Visual Studio not being able to locate the file. To remedy that, open the Options dialog, expand the "Projects and Solutions" tree, select "VC++ Directories", select "Win32" and "Include files" from the combo boxes at the top, and ensure that $(VCInstallDir)atlmfc\include is included in the list:

  Visual Studio Options - Projects and Solutions - VC++ Directories - Win32 Include files

Of course, the ribbon control (and other ribbon-specific items) weren't added to VS 2008 until the MFC Feature Pack. You will need to download and install that in order to compile applications that take advantage of those features in VS 2008. You can download the Feature Pack here for free.

Cardinalate answered 11/3, 2011 at 9:36 Comment(3)
Nope, i didnt get the file :(.. so do i need to install feature pack for that?Impaction
@LLL: You could try installing the feature pack, but it's an awfully big download if you're on a slow connection. If you're not using a ribbon control, you really shouldn't need it. Are you trying to build a project created with a newer version of VS? Did you try creating a blank project in VS 2008 like I suggested? How did that work out?Cardinalate
Yes, blank project is fine.. but in one of the existing project, "afxcontrolbars.h" is included, VS is saying its unable to find file.. i am downloading Ribbon controls lets see.. ThanksImpaction
R
1

I have VS2008 on a Win7 64 bit machine. In my case the include files where installed in the c:\program(x86) folder, but VS was installed in c:\program.

By changing the path to the "hardcoded" path

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\include

it now works!

Rheumatic answered 10/5, 2012 at 15:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.