views:

169

answers:

2

I'm just getting started with Visual C++ but I've run into a brick wall. I'm trying to make a new class, so I right-click on my project, Add|Class, C++ class, and call it "piece". This creates "piece.h" and "piece.cpp". So far so good. When I try to include "piece.h" in my main.cpp file however, when I compile I get

fatal error C1083: Cannot open include file: 'piece.h': No such file or directory

Can anyone tell me what I'm doing wrong please?

+1  A: 

Are you using quotes "" or angle brackets <> for the #include? The angle brackets don't search in the local directory, so you'll miss the include files you create there.

http://msdn.microsoft.com/en-us/library/36k2cdd4.aspx

Mark Ransom
Although this wasn't the answer I was looking for, I'd rather accept your answer than mine, as yours is more generally helpful. Thanks!
Skilldrick
A: 

The problem was with the way the project was set up. I've made a new one from scratch and everything works fine now.

Skilldrick