Skip to main content
gamedev.net
🔒 Locked

Cannot open include file in C++

Started by Mark04 Nov 20, 2004 at 11:22 AM 6 replies 9.2k views
Original Post
Mark04
Mark04
Hi everyone Been trying for weeks to figure this out, can anyone help!! I got a program in C++ but when I try to compile I get this error: Compiling... PROJECT.CPP c:\my_projects\program1\project\project.cpp(4) : fatal error C1083: Cannot open include file: 'project/mouse.h': No such file or directory Error executing cl.exe. PROJECT.exe - 1 error(s), 0 warning(s) I have checkd the main project folder the mouse.h is in there!!! Any idea how I can fix it. Thanks Mark.
mike25025
mike25025
try #include "mouse.h"

if that doesnt work post some code and a directory tree
Aprosenf
Aprosenf
Make sure you're doing

#include "mouse.h"

i.e. with quotes, not angle brackets. As long as you're doing that and mouse.h is located at c:\my_projects\program1\project1\mouse.h, then it should work fine.
Mark04
Mark04
Hi.

OK, That worked, Thanks! But now... Another one has popped up.

"Cannot open Alloc.h"

This file is NOT in the project folder. Any ideas where this might be located or if there are any recommeded include/library downloads?

Mark.
pex22
pex22
use angle brackets.
in c/++, "file.h" means file.h is in the current (project) directory
and means file.h is in one of the compiler included directories (i think it also looking for file.h in PATH paths)
alloc.h is probably inside the compiler headers directory, which is probably already inside the compiler included directories list.
to access the list so you can see, add or remove the directories, see Options or Settings (or Help?) in your IDE.
in VC, it is in Tools->Options->Directories. in "Show directories for:", choose "Include files"
pex.
Mark04
Mark04
Hi.

Thanks for the info but it seems that If I finally locate one then it cant find another one.

Are there any recommended libraries to download that include all these include files. I need: Malloc.H and Graphics.H mainly.

Thanks

Mark

MaulingMonkey
MaulingMonkey
Quote:
Original post by Mark04
Are there any recommended libraries to download that include all these include files. I need: Malloc.H and Graphics.H mainly.


You poor bastard, you've been reading from a book that uses Turbo C++ as a compiler.

Malloc.H dosn't exist on most systems. All the functions that it contains are instead located in:

#include

Graphics.H dosn't exist on most systems. There are billions of different libraries out there... okay maybe only a few thousand... that do graphics. Since turbo C++ is 2d/pixel based, the closest equivilant is probably ClanLib, although you might want to check out SDL and OpenGL (a 3D graphics library that is often used for 2D as well) - a good site for tutorials for OpenGL is found here on this very site! Link: http://nehe.gamedev.net/

If anyone feels like pointing this guy to some good tutorials and books, feel free - most of the ones I learned from were bad and taught very bad programming practices (it's a wonder I managed to not learn the bad practices!!)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.