user228058
user228058

Reputation: 475

c++ fatal error c1083 project was fine before, what now?

I have a (com) c++ project, which uses a (.net) c++ dll. The project was compiling and running ok.

Now, all I did was make changes to the dll, and I'm getting a fatal error c1083- cannot open include file stdafx.h - when recompiling my (com) project.

What can this mean?

Upvotes: 3

Views: 526

Answers (2)

John Dibling
John Dibling

Reputation: 101446

If your include statement uses angle brackets:

#include <stdafx.h>

...try changing it to use quotes instead:

#include "stdafx.h"

The two are different. When you use quotes you tell the compiler "ok first search the local directory, then go to the search path." But when you use angle brackets you tell the compiler "DONT look in the local directory, just search the search path." In the case of stdafx.h you want the one that is part of the project, so you want to search the local directory first.

Which brings me to a pet peeve of mine, but that's a story for another show...

Upvotes: 0

Agnel Kurian
Agnel Kurian

Reputation: 59456

Look for your stdafx.h. Here are the possibilities:

  1. If it isn't missing, try restarting you machine. You could also use sysinternals' handle.exe to find out who's holding that file.
  2. If it is missing, create it.
  3. On the other hand, it may be possible that your project did not originally use pre-compiled headers and the option was turned on in error. So, switch off the pre-compiled header option in project properties.

Upvotes: 1

Related Questions