views:

78

answers:

1

I am using Visual Studio 2010 to make a 3D model in C++ and OpenGL. I started a project on my home pc, and then decided to put it in a repository, so that I could get the code for development on my laptop and not have to keep transferring files between the two computers (and also just to get some practice at using source control).

The problem I have is that when I load the project on my laptop and try to build it I get an error saying that stdafx.h can not be found. The stdafx.h file is included in the header files folder, and when I click on it the relative path is just stdafx.h

So how then can Visual Studio not find a file that is already in the project? It works fine on my home pc but refuses to work on my laptop.

I have tried changing the precompiled header settings to YU instead of YC but this did not fix the problem.

I imagine I am overlooking something fundamental here but I can’t figure it out.

+1  A: 

What I have situations where an application can't find a file in the place where I think it should be looking, I always run ProcMon ( http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx ).

99 times out of 100, you'll find it's doing one of the following:

  • Finding the wrong file somewhere else first
  • Not looking in the place I thought it was looking
  • Finding the right file, but lacking permission to open it.

Start ProcMon, and filter on Paths which Contain stdafx.h. Then compile and see what you get.

Will Dean