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. :(

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Naruto
  • 9,476
  • 37
  • 118
  • 201

2 Answers2

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.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
  • Nope, i didnt get the file :(.. so do i need to install feature pack for that? – Naruto Mar 11 '11 at 09:45
  • @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? – Cody Gray - on strike Mar 11 '11 at 09:46
  • 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.. Thanks – Naruto Mar 11 '11 at 11:41
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!

Coding Mash
  • 3,338
  • 5
  • 24
  • 45